This is an interesting one, data was loaded into PostGIS via FME or similar workflow, it is perfectly valid WKB.
WMS works fine as it makes use of ST_Force2D when accessing.
WFS does not work out quite so well, data of the form:
Comes out in GeoJSON, GML2, GML3 as:
The fix should be to pay attention to the geometry dimension and compare / contrast with srs dimension to detect if measures are used.