After spending a few hours trying to track down a strange behavior, I found the reason for it. It only happens when I try to run a Delphi application that uses a DLL which makes heavy use of OCC. When it runs in C++, the strange behavior does not pop up.
In my copy of OCC 6.3, in file ais_interactiveobject.cxx, lines 56 to 69: myHasTransformation is NOT initialized. It should be set to Standard_False. It caused detected/selected shapes to be given a different location, thus making them impossible to track.
I modified my local copy to include the fix, and I hope you include it also in OCC's code.