With good modding, no code is needed. And with bad modding, the best code imaginable can achieve nothing. It is all down to the quality of the modding.
The justification for the banhammer is "I think you should be banned." The CoC doesn't enable or permit the mods to ban you. The mods can ban you because they're the mods; "can ban you" is pretty much definitionally identical to "is a mod." At most a CoC can serve as a guidebook for users.
This is nonsensicle and shows a lack of understanding. A code of conduct is just a guidebook for users to understand how your moderators will act, what to expect in a community.
I guess I agree with that. But then there's still no point in using a prefabricated code. The code should be a README, a guide for users to predict mod behavior. An aid to the primary modding tool.
Moderation starts and ends with the mods, not with the CoC. The CoC just saves labor.
Using a prefabricated CoC is what you do when you need to fulfill a checkbox item saying "has a CoC", but have no intention of actually following it.