if i am in creative and i spawn in a zombified piglin it will spawn then despawn like i didn't try to spawn one in. normal piglins will run away for a split second but when it disapears the piglins resume their normal activities
this is in the nether ( as i have not tried in the overworld)
You're probably in peaceful mode. It's just hard to notice because piglins and hoglins are intended to stay in peaceful mode.