That's not true. In fact, it's a specific misrepresentation of the CoC. Whoever planted that idea, did it in bad faith:
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
It's very specific. If you're representing the community, and you say something bigoted, then, yeah, that might be brought up. But that should be the case. No project wants its representatives doing stuff that reflects badly on the project or which creates a bad culture in the project community.
Besides, it's also just not a very good idea to post bigoted things, both in terms of making a better society and culture, and in terms of just following the Golden Rule and being nice to other people.