@merlin246 perhaps use

M376: Set bed compensation taper

Then after the taper height I guess there shouldn't be any mesh related z moves for the rest of the print?

Just a thought...
Cheers
Barry M