It works for me, I hit Alt-A to start the animation and then I move the camera with the G mouse.
Also as a side note if changes happen to the method “my_handler” and the script is run again, you will need to append the handler again. But you don’t want to append the same handler more than once. You see if you press the “Run Script” button 3 times and you go the console you will see this problem.
>>> bpy.app.handlers.frame_change_pre
[<function my_handler at 0x0000009A42290510>, <function my_handler at 0x0000009A42290598>, <function my_handler at 0x0000009A42290620>]
The most easy way is to clear all of the handlers in the beginning. Just to make sure you use only the fresh handler.
P.S. There is another one more complex to check if the name of the function is in the handler list and remove that, but when you will need it you can ask.
If it was being moved by a constraint, like for instance copy location to another object, the constraint postitions the object without changing its location property, hence the need for matrix_world.to_translation. Without seeing your file I can only speculate…
If the previous code reports a location that is different from that in the properties box, then that is a problem.