I just wanted to share my experience, in case it could help others. Unless one thinks I am too stupid.
I had an object on a form which refused to change visibility status and always remained visible but, when I tested if visible was true or false, it was always false, e.g. it should not have been visible.
I suspected that the problem was that two objects had identical names, but could not find any duplicate.
It took me three hours (maybe more) to discover that there were two objects with the same name, but one was just one pixel, it had the same colour of the background and was underneath another object, so it could not be detected.
No, I think that, as the name of the one-pixel object was the same of another element, it was not shown on the list. So I could see only one object. And when I deleted the “normal” element, the name was still there. At this point I suspected that my guess (e.g. two elements with the same name) was correct but I still could not see where the duplicate was.
I admit that this behaviour should not be normal, as Servoy usually renames duplicate objects. So I suspect that there is probably more than just an error made by me.