In essence the drone knows only its height relative to the take off point and all height limits set by you in the app are relative to the take off point.
The height above the ground, known as AGL, is unknown to the drone ........ unless the drone is low enough for the 'ground' to be within the range of the downwards looking sensors on the bottom of the drone, let's call this detected height "VPS height".
Most, if not all, DJI 'Mavic' drones have such sensors but the drone only acts upon them when 'very' low. They are what causes the reduction in descent speed as the drone nears the ground, they also are the source of "landing protection". Be aware they are not infallible and actually detect the nearest object beneath the drone that is within their field of view ... so stick your hand under a drone and the drone may climb away from it slightly.
From memory the
M2P reports the VPS height in either the App or on the screen of the RC1A/B controllers, I do not know about the smart controllers.
With regards to your question, in mid air flights the drone makes NO ATTEMPT * to correct for changes in the height of ground. So, with regards to your flying beyond the drop off, the drone will stay at the height it was relative to the take off point and you would be breaking the 400ft AGL rule as soon as the drone was beyond the drop off.
* there is an exception to that when you fly the drone SLOWLY up a slope, landing protection can force the drone to climb to avoid the rising ground but it does not respond to descending ground.
The drone will happily fly to heights below the take off point and will show negative height values when below the level of the take off point.
An RTH would entail a climb to the RTH height relative to the take off point, so if you set the GoHome height at 257FT and started the RTH when the drone was at -361ft an RTH would entail a climb of 618ft.
Note HOWEVER that there are exceptions to that rule that are governed by the drone's distance from the homeport. You will need to read the manual to find out the distances, the
M2P's RTH behaviour can be quite complicated depending on which settings are on. From memory the drone will RTH at its current height if the drone is within 'x' ft of the home point, check "x" in the manual.
Beware of flying to close to cliffs etc. just incase they cause loss of GPS, that can complicate matters and has caused some drones to get 'stuck' below the lip of canyons etc., I can never remember the exact circumstances in which that has happened, I just remember that it can happen.
My lowest point so far is somewhere around -400?ft at a sea cliff.