This still doesn't work unfortunately when fd is for the file not accessible directly (sounds like weird condition, but that's what we have in Proton now with Steam runtime where your similar patch worked once but stopped doing so). Also there is sort of similar issue when the std handle relates to a special Unix file (like pipe or fifo), in that case it is exposed as pipe but pipe's operation doesn't work and that breaks some runtimes (not sure now about python specifically).
I don't want to say that it necessarily makes this patch not useful, just probably the only sure way to avoid the issues with std handles coming from Unix side is to avoid those when it is important.