Again I don't use Marlin so I'm not totally sure but I've had a fiddle with the Marlin configuration tool here(N.B. I have no idea if that's recommended) and looking through the files it generated for me there's a line called
So maybe you should see if you have that line in your files, and if not putting all your printer details into that config tool might get you what you need.
"deltaheight":in the configuration.h file, whereas
Z_MAX_POSonly shows up in configuration_cartesian.h
So maybe you should see if you have that line in your files, and if not putting all your printer details into that config tool might get you what you need.