I'll chime in here--I've been having the exact same issue, with nimble and with another (bespoke) package I've written. It took me a few hours of rabbit-holing, but I found that R 4.2+ seems to have a problem with multi-coring (sorry, I didn't save the links). In my case, it was really weird--I'd run a multi-core job in R (nimble or my own package), and it would work and shut down the workers just fine. Then I'd run it again in the same R session and get the error Sanjib noted (nimble only, my own function had a different error message). I was not changing anything in the function used by the workers itself.
I tried using the parallel package (as per the instructions Sanjib linked to), futures/doFutures packages, restarting R, restarting and updating all packages, manually deleting the parallel, etc. packages then re-installing, and so on, but I'd still get the same behavior. It was really strange, and left me unable to use some functions in MC mode.
What I found seem to work was simply re-installing R (same version--4.2.1). Also, I have an intuition that any calls to setwd() (outside the worker code) may have made things go awry, but I'm not sure of that. There is nothing in the worker code that needs access to a folder I created, though.
It's not a great solution, but it's working for me at the moment.
Adam