Same code working differently on Nano 33 IoT and Mega

What exactly happens or doesn't happen? Can you be more specific?