It looks like you are going into the same error after buss off recovery. If the MCU is in the bus off then it does not sends any frames. A bus-off node is not allowed to have any influence on the bus (e.g. output drivers switched off). It looks like you are facing behavior presented in attached files.
What I would like to suggest you is to abort the messages and fix all mistakes:
if (CAN0TFLG != 0x07)
{
do
{
if( !CAN0TFLG_TXE0 )
{ CAN0TARQ_ABTRQ0 = 1; // abort the transmission
while ( ! CAN0TAAK_ABTAK0 ) {}
}
if( !CAN0TFLG_TXE1 )
{ CAN0TARQ_ABTRQ1 = 1; // abort the transmission
while ( ! CAN0TAAK_ABTAK1 ) {}
}
if( !CAN0TFLG_TXE2 )
{ CAN0TARQ_ABTRQ2 = 1; // abort the transmission
while ( ! CAN0TAAK_ABTAK2 ) {}
}
}
while(CAN0TFLG != 7);
}
Best Regards, Ladislav