Yeah but it also didn't work on Luffy.
Sure, you could try to argue that Luffy's haki was too strong or smth, but that doesn't really check out since that would mean pre-TS Luffy (who hadn't even learned haki yet) had stronger haki than Yonko Blackbeard. And also no one was saying "Wow his haki must be too strong!" They were all saying "Wow this guy isn't attracted to Hancock!"