At the very bottom of fsl_flexcan.c there is this:
assert(NULL != s_flexcanHandle);
I think there is a mix-up between FLEXCAN1 and FLEXCAN2, higlighted in red. I'd appreciate your confirmation.
The SDK where the bug initially showed up is version 2.9. I double-checked that the bug is still present in the latest version 2.11.1, archive file SDK_2.11.1_MIMX8ML8xxxLZ.zip. Please see file SDK_2_11_1_MIMX8ML8xxxLZ\devices\MIMX8ML8\drivers\fsl_flexcan.c, line 4638.
The device is an i.MX8M-Plus. The reported bug is believed to be board-independent. Just for your reference, the board is a BoundaryDevices SoM with a custom carrier.