Hi, Dimitri. Thanks for your paste.
In month view, a query currently runs for every single day. Please note that this is liable to change in a future release; however, at present, eventDisplay for those particular queries is set to ‘custom’. and you would need to change your code to catch this.
Since this is really a bespoke customization, we can’t provide too much more help, but you might also consider (should it be easier) overriding the relevant template and testing each event to see if it belongs to one of the ‘banned’ categories and then skipping it (or not) on that basis.
I hope that helps get you on your way. Sorry we can’t offer more in-depth assistance.