Yeah I have tested a little bit more as you say, it wont work.
so reverted to main branch, this is what I see
https://imgur.com/a/fDHraGv
It works at the start, starts outputting some holmium then it stops.
I see that If I change the machines quality while it is working, it goes like limbo state, machine stucks at 100%, still output stuff via coupons.
https://imgur.com/a/zPpt4s5
Ok so If I make the high quality machine first, then swap back to lower quality one, it feels like infinite (I haven't check there on code, maybe it generates 1024x so fast and coupons stack(I reverted maybe internal value?), machine cannot output that fast)
If I make the low quality machine first, then swap back to high quality one, machine waits for coupon, but it wont output anything to pipes.
https://imgur.com/a/2nKjaO1
I dont know this helps but here one scenario that I have created with my small number mods ^^
scenario: https://filebin.net/rccom1vgpvi3duzx/buggy.zip
save file: https://filebin.net/rccom1vgpvi3duzx/buggy_save.zip
Let me know if you need anything, thank you
Edit: so for now as a quick solution, make the changes first(machine quality, modules etc) then start putting stuff. it seems like it works fine as intended.