VSCode evaluate selection fails to launch REPL

Throughout this semesters course, I’ve been using an Ubuntu VM with VSCode. Recently, towards the end of the course, I decided to try and setup WSL since the VM was a little slow on my laptop. It was working fine for a while until after a windows update (Might not be the cause of the problem). Now whenever I highlight some code and press shift + enter to evaluate it and put it in utop, VSCode returns this error:
Could not start the REPL: The REPL terminal could not be open
The terminal process “/usr/bin/opam ‘exec’, ‘–switch=default’, ‘–set-switch’, ‘–root’, ‘/home/aidenr/.opam’, ‘–’, ‘’” failed to launch (exit code: 2).

The terminal shows up for only a split second, but if I freeze my screen by taking a screenshot I see this error:
Fatal error: exception /usr/bin/opam: “execvpe” failed on /home/aidenr/ .opam/default/bin/: Permission denied

I tried to chmod -R 755 on .opam to grant more permission but that wasn’t the solution.

I tried to setup a new switch on 4.14.1 but that didn’t help either.

This happens on all my machines now including the VMs. Due to this, I believe the issue lies with VSCode syncing something incorrect, but I’m not sure what or where to find it.

I can still run utop and paste code from my text editor manually into it and it works fine, so it’s not the most important problem to solve, but if anyone has any ideas or has had a similar problem I would appreciate any info.

Could try (temporarily) turning off your antivirus or malware checker and see what happens.