The governments are tricky. We want the AI to create the best possible governments, but as it has no idea of the concept they're for, it generally chooses poorly, or not at all (even worse). This is why we always generate a new gov building when an AI takes over a city. It's not all that common for a settlement to change hands extremely often though, so it should only cause a rare crash.

I'll add a solution to the frequent issues though, about taking over settlements that have been contested a lot and destroying all the gov buildings. Thankfully we won't have as much problems with the government buildings in EB2.