Insurance is regulated by state. Each state can adopt a different approach to the issue that you have raised. In California, the voters took rating matters into their own hands with a constitutional amendment. Sex or gender, as you say, is not a rating factor in California. That means that in California if you switch sex, switch back and switch again, nothing will change as long as you are residing in California, and driving a car insured in California.