Try replacing ztools for the old one. I changed hactool build as someone said to me it was giving him issues with his computer. Also between 6.5.1 the only change is a line to prevent [lc].nsp creation in the case the nsp has no ticket (custom nsp) as it isn't necessary in that case and was giving a blank nsp.
You have 6.51 here
https://github.com/julesontheroad/XCI_Builder/releases/tag/v0.6.5.1
And 6.52 rev1 here
https://github.com/julesontheroad/XCI_Builder/releases/tag/v0.6.5.2
Try with them if you want 6.5.1 should be fully functional with the exception of making empty [lc].nsp in custom-nsp cases, which is no issue as you don't need them for them (to prevent it's generation was more of an aesthetic thing).
Bigjokker had also an issue with nsp generation but he solved it reinstalling python 3.7 if you can try to do that.
Also you'll have a new one tomorrow with the batch processing, i don't know if it'll solve your issue though, if it's still persisting I'll give you my discord so we can try some things to identify and fix the issue. Regardless those [lc].nsp are equivalent to the [tf].nsp or tinfoil nsp from CDNSP Bob, you can use them in the meantime, they'll serve the same purpose. I only changed it's name because recent versions of tinfoil with signature verification won't install them. At least in my case in SX OS.