DefaultCompoundCRS can be used for combining various kind of SingleCRS instances, for example a ProjectedCRS and a TemporalCRS. But there is one combination which is explicitly forbidden by ISO 19111: a two-dimensional GeographicCRS instance with a VerticalCRS of type "ellipsoidal height". In this particular case, a three-dimensional GeographicCRS instance shall be created instead.
There is currently nothing in Apache SIS that enforce the above directive. Consequently geographic CRS with ellipsoidal height can currently appear in two different forms (one legal and one illegal). This will complicate the search for transformation paths when we will implement CoordinateOperationFactory. We should add a check in DefaultCompoundCRS constructor that disallows the illegal form, but this will break the code of all users that were not aware of the three-dimensional geographic CRS special case.