I can’t reproduce your problem, I tested to 3000 frames using your code at a 60Hz framerate, using Ubuntu 22.04 and PTB 3.0.18 with a Seeeduino Xiao:
My oscilloscope shows a really nice square wave @ 33ms period time confirming the digitial write.