Based on your description the error message sounds like a red herring and you might indeed be hitting a setup issue. I don’t know what differences are between the environments, so can’t comment on a potential root cause.
In the past I’ve seen “random” CUDA errors if you were already hitting a sticky CUDA error, the CUDA context would thus be invalid, and would then try to run more CUDA operations.