A potential fix has been submitted to the master branch.. not on npm yet as I have not been able to recreate locally. If you want to try you can install manually
cd ~/.node-red
npm i node-red/node-red-dashboard
Note - this can take a very long time to install on a Pi - for some reason yarn
installs it much more quickly.
Note2 - I don't know if this fix cleans up any excess groups etc... It may just prevent them occurring... so you may still need to tidy up first... as I said I haven't yet been able to recreate this locally.