As I have never found the need for calling view elements from the controller -- again, this completely violates the MVC principles -- I have never ran across this myself, but I have tested it and you are right: in JS views it works, JSON and XML views don't.
The reason is that the ID of the object in the latter two view types is being prefixed by the view id, resulting in something like "__xmlview0--idProductsTable" (you can see this when inspecting the DOM element).
Using sap.ui.getCore().byId("__xmlview0--idProductsTable") would then work, but this is not expected, and probably a bug.