Looking at this:
[lat,lon,h] = ned2geodetic(xNorth,yEast,zDown,lat0,lon0,h0,spheroid))
The obvious question is by how much the current location on local Cartesian NED
(xNorth,yEast,zDown) can be far away from the reference point
For example if the reference point is in Australia and the current location is in the US, does those "mathematical tricks" still will be valid?
I assume that there is an intermediate step of-
Local Cartesian NED to geocentric ECEF: https://www.mathworks.com/help/map/ref/ned2ecef.html
Since they also using Geodetic reference point - probably first converting the Geodetic reference point to ECEF, and then there is the questioned "mathematical tricks" to "add" current local Cartesian NED to that reference point (already represented in ECEF) so the current local Cartesian NED will be in ECEF - Thus the "mathematical tricks" are some sort of Cartesian/Vectorial manipulations, I suspect how long they holding in the context of maps, geodesy etc?
Regarding converting Geodetic reference point into ECEF in the intermediate step mentioned above, and in the final step converting back current Cartesian point (already in ECEF) to Geodetic, they use:
Transform geocentric (ECEF) to geodetic coordinates: https://www.mathworks.com/help/map/ref/ecef2geodetic.html
Assuming this is pretty much straight forward formulas with known limitations (Characteristics of different methods to convert ECEF to LLA) So I don't see how they interfere here...