He might’ve told them about his lineage. It’s weird as fuck that they made him into a warlord if they knew.
Nah, it's a retcon so it doesn't necessarily add up, but we know for a fact that Teach had his subordinate ask Sengoku to set up his warlord position for him, instead of going personally. The Gorosei and even Sengoku/Garp probably figured out by MF, especially since Teach named his ship after Rocks. I don't think it would make sense for Shamrock, who isn't old enough to remember Rocks, to go and tell the elders about Teach being related to him.