I deployed the two programs again and had the same problem as before. Then I went through all the deployed .dll's and there were some missing. I copied them inside the folder manually and now it works.
So the problem was windeployqt or some missing windeployqt-commands while deploying.
Thank you again, I'll close this topic now.