I think the problem is solved 😄
@steve123
I've connected the PSU to the Duet board with 2.5mm^2 solid core wires, I think that's 14 AWG.
You have a good point about the total amperage though, maybe my PSU isn't quite able to keep the voltage steady. I've set the M906 command to allow max 2A instead of 3A and so far it seems to work much better. I haven't heard the same noise anymore and the "B phase disconnected" error hasn't popped up anymore either.