I found a solution! I do not know what the problem is exactly. I think the Simulink FMU wrapper is not as powerful as other tools to implement FMU's. I found the following package: https://sourceforge.net/projects/matlab-fmu/. There are functions to implement FMU's in matlab code. It is then possible to execute an FMU in a loop. No error.
Thanks