Hi,
I've attempted to fix #95003 bug report for pymoctool binary of the corresponding package.
Hopefully it's done correctly.
In the process, I also added _better_ autopkgtests so that issues like these can be easily detected if they arise later.
Also did a bit of QA work for this. I've pushed the changes to the salsa repository[1].
Please consider to sponsor, or grant DM access so I could simply upload.
Nilesh