There is a variable called +workspaces-on-switch-project-behavior. Its documentation states
Controls the behavior of workspaces when switching to a new project.
Can be one of the following:
t Always create a new workspace for the project
'non-empty Only create a new workspace if the current one already has buffers
associated with it.
Did you save the .dir-locals.el file? Are you loading these files via TRAMP? By default, Emacs doesn't look for the .dir-locals.el file when loading files via TRAMP, as it might add significant delays. If this is the problem, you can set enable-remote-dir-locals to t to opt in.