After further investigations I found the issue is related to the CBSubs Content plugin, that acts on the onAfterDispatch joomla event
Now I don't know what to do next...
Here is the discussion with the CB developers: https://www.joomlapolis.com/forum/255-developer-members-support/243604-issue-with-joomlart-t4-templates-and-cbpaidsubsbot#323327