I've been able to reproduce one of the circumstances under which this occurs.
Select some code.
Go View/Hide selection.
Save and close.
Reopen file. Collapsed section is still properly flagged.
Now hit your undo sequence (I'm using Vim emulation). (You might need to do this more than once to return the file to its condition when reopened if you've made some changes since opening.)
Your collapsed section is expanded and the marker is lost so you can't collapse it again using 'plusminus'.
There might be a clue in the command line message which says;
Cursor movement,Line flags undone
It looks like the undo is trying to undo flags set to denote collapsed sections, but this shouldn't be happening as these flags were set during a previous editing session and should be impervious to undoing.
Does this happen for anyone else?