I solved my own issue by adding “C:\Users\tobil\AppData\Local\FiveM” to the folders the app can access in the sandbox settings.
Now I can connect to the server when running fiveM with Sandboxie.