I get that it’s popular here to insinuate the developers are stupid and can’t “code” but City-States not building other districts is actually a purposeful design choice. So not only are you wrong, but the way you’re conveying your distaste here is also quite rude - remember the human when you offer criticism of any game in a publicly. The developers read this forum too, and not only is it childish to talk down to them like this, it probably makes everyone likely to take you seriously.
Now, regarding the districts:
As a poster above said, City-States can only make their type specialty district plus harbors (maybe aqueducts and neighborhoods too, I forget). All other districts are purposefully not included in their valid build list. Why? I’m not sure but I think it has something to do with trying to keep them able to defend themselves better. By limiting what they can build, they’re then forced to focus more on defensive buildings and units which can help them hold off attacks from civs.
So it’s not an “AI” thing whatsoever. It’s a design choice and it can actually be modded very easily. In my personal mod, I allow City-States to build everything except government districts. I believe the City-States Expanded mod also allows it.