3GPP 24.501 v20.0.0 — the document's own text
7.4 Unknown or unforeseen message type
Taught in 7. What a NAS message looks like on the wire (CT1 — the group that writes what your phone says, in depth), 4. Inside TS 24.501, the document at the centre (CT1 — the group that writes what your phone says, overview).
If UE receives a 5GMM message or 5GSM message with message type not defined for the extended protocol discriminator (EPD) or not implemented by the receiver, it shall return a status message (5GMM STATUS or 5GSM STATUS depending on the EPD) with cause #97 "message type non-existent or not implemented".
If the network receives a 5GMM or 5GSM message with message type not defined for the EPD or not implemented by the receiver in a protocol state where reception of an unsolicited message with the given EPD from the UE is not foreseen in the protocol, the network actions are implementation dependent. Otherwise, if the network receives a message with message type not defined for the EPD or not implemented by the receiver, it shall ignore the message except that it should return a status message (5GMM STATUS or 5GSM STATUS depending on the EPD) with cause #97 "message type non-existent or not implemented".
NOTE: A message type not defined for the EPD in the given direction is regarded by the receiver as a message type not defined for the EPD, see 3GPP TS 24.007 [11].
If the UE receives a message not compatible with the protocol state, the UE shall return a status message (5GMM STATUS or 5GSM STATUS depending on the EPD) with cause #98 "message type not compatible with protocol state".
If the network receives a message not compatible with the protocol state, the network actions are implementation dependent.