I know this issue exists, but the original was closed due to inactivity, I don't know if writing there will re-awaken it so I am making a new one, feel free to close this one and re-open the original.
https://geometa.co.uk/support/stormworks/18887
I have encountered this issue many times, it seems the easiest way to reproduce it is to fall from a decent height.
My suspicion is that the character controller gets stuck on the other side of the geometry, and that's why you get inverted.
I have tried it in many situations, last time was in career mode when I was flying in a chinook my friend built, with him as the pilot, I got up during flight and was sent flying into the ceiling, where I got stuck with inverted controls. It took me a while to get out as I could not reach any seats. I have also gotten stuck inside a house I couldn't walk out the door as I collided with it instead.
But as said, the easiest way to replicate is to collide with something relatively fast, which is why I suspect the character controllers collider gets stuck inside the collider and is therefore inverted.