It happened for me every time. The thing is, when you level up, your stamina actually resets to what value you have at maximum at current level, but system shows you that your stamina is that value+what stamina you remained with before leveling up. It's just a visual bug.

Because, if you try to use 1 Exploration Point for gaining some stamina, when you finish that, you can see your actual stamina and not some kind of tricked value.

The error that is showing is simply an error that shows up whenever your local value of any variable in-game doesn't match with the server-sided one.

For example, if you try to modify your Gold value using Cheat-Engine, you can do that, but if you try to use your gold and you actually didn't have the amount that you need, but you do now by modifying it (for example 200k for an evolution) that error shows up. It's just that.