Um, eek?
You didn’t mention the bike.
Either way you would want the piston to retain the same timing & squish clearance as before when tightened up. The timing is affected by a piston height change so a spacer on top will change the characteristics retarding timing somewhat & pressure leak is more likely & a few other things.
As I am typing I am thinking the piston could be different in many other ways such as ring peg position, bearing retention on wristpin & skirt vs sealing of ports. I would really have to look at it to say go ahead, so is it from a different year same model? Why the change?
More info required.
Um, ok well assuming the piston is the same except for that, then yes you could put a spacer under the barrel to retain status quo. This would mean the spacer (when compressed) was equivalent to the height change of the piston. Use a base gasket either side of the spacer removing 1 base gasket from thickness.
Hmm, surely you can find the right piston?