The problem is caused by some bug in OpenBVE's implementation of Windows Plugins.
I have no idea how to fix it, and in fact, im pretty sure that it will not be fixed because Michelle wants to drop support for Windows DLLs entirety.
If you want the bug to go away, convert the R38 to use a .NET plugin.