or some peripheral event
noise from mcu, its load currents changing lifting psu and ground line parasitics
but you should be able to fix it by fixing the psu and ground traces and filtering
my guess is the ground trace is to thin/long and maybe is coupling into other traces or ics
or the grounding on the mcu is crappier than the piezo
really if either arent good, or exactly the same level of sucks, youre going to have interference issues

if that doesnt work youre ground is prob fucked
star ground all of the things all of the time
okay maybe not all of the time but really most of the time
then you have to much distance between your pieze ground, mcu ground, psu grounds
im never sure about anything ever until ive tested it like 10 times
but yeah it would make the most sense
also try setting the pin hi-z instead of output low
big fat blue wire from the pieze ground to mcu ground
and it usually depends on your code