UE4 Editor Often Crashes When Play Is Pressed When Using Static Library

I have linked a C compiled static library (lib.a) to my project in myProject.build.cs.
I have tested the library with another C++ program and compiler and all is working properly.
However when I call any function from the library in my unreal source the editor engine will almost always crash when I press the play button. Other times it will play but crash when I press stop.
What could be causing this?

I also have this same issue with Unreal 5.5 engine project. Does anyone have a workaround or fix for this issue?