Not sure of your year machine, Are you missing the locator pins ??
I've had this problem everytime I open the head from the very first time I did the first top end job. I bought the bike new.
Resurface, new studs, all kinds of gaskets, even had a pro motor builder scratching his head.
My so far (two top ends) remedy - resuface head, stock steel gasket, a thin film of Yamabond 4 around the head and cylinder mating surfaces. tourque to factory spec. I've haven't had any issues yet.. I also don't remove head when replacing the piston. I just slide the cylinder with attached head off as one.
ps - leave head stay as last step, fill with coolant before tourqing head stay to spec. Good luck