I had to focus on other things for some time and forgot about this. Now I came back to this part of my code and re-discovered the problem.
I managed to make a very small project that does show the problem. There are two things to test:
- Press the button when the red box IS NOT showing - everything continues to work as expected.
- Press the button when the red box IS showing - the box is gone forever.
To summarize, this seems to be the problem: Iff a view is visible and is touched by SetVisibleAnimated, then it can't get back its visibility using Visible.
(I checked in B4A and there this all works as expected.)