This issue might be related to
Geometry functions should be more restrictive and produce an error in case parameter is a valid geometry but has the wrong type.
According to the OGC standard definition the return value for a
function is NULL if the geometry is NULL (RETURNS NULL ON NULL).
The standard also defines the valid geometry types for functions:
7.2.9 SQL routines on type POINT
The SQL/MM ST_X, ST_Y, ST_Z and ST_M routines and all routines supported by type GEOMETRY shall be supported for geometries of type Point.
- ST_Z() (not implemented yet)