In the latest version (21.11.63) I’ve added new reporting category type to handle reverse amounts on tax code level.
It’s not something I wanted to do but it will achieve what we need without custom script.
When you look at report transformation, you will see correct total now.
And drilling-down works propertly too:
Please double-check everything works as it should and then you can mark the report as published.