Also consider using the link I provided you and posting to the "3.0.x Mod Requests" forum there. That's where I would post on said issue.
Because your original script worked on my phpBB, I could not have foreseen this "complication" simply by introducing a category constraint, and phpBB has used the same category format for roughly 8 years. Until, of course, now! Sorry if I seemed to get a little miffed, it was totally perplexing at the time and a complete surprise you couldn't get it to work considering I tested it, blah blah blah.
Glad we got to the bottom of it, eventually, enjoy your shiny new phpBB and hope someone out there helps you out soon. Cheers and good day.
😎
-jim