I solved, in practice I use the siteorigin web page builder and if I inserted the tag inside the text editor it could not interpret it correctly. Instead I add a custom html block and insert the TAG Query there, the shortcode works correctly.