Yes, I did fix it.
It was a problem with the interruption of receiving messages and the priority set to the interruption. I can recall it was interfering with the real-time tasks priorities because every time I regenerated the code through MXCube it regenerated the interrupt vector and changing the priorities to something lower than the tasks and firing the error flag.
My solution was to comment out/delete the lines that set the priority of the interruption on the autogenerated code and just have that in my code, so that the priorities are set correctly.
You can now see the solution in my github (link is the same) and how that autogenerated code is also set in the object of the FDCAN library.