Thanks for the help!
I tried all the suggested solutions, but none worked. After a hardware change on my computer, I reinstalled Windows, VS Code, MSYS2 and everything worked properly.
Unfortunately, I can't pinpoint the exact cause of the issue. Reinstalling is most likely not a good solution for others facing the same problem.
However, when I still had the issue, the launch.json file helped that i could compile and run the code. I recommend starting there to investigate how the .json file affects the dll's that are called when compiling. It might lead to a solution.