after migration from pi3 to pi4 everything works fine but the dashboard button in the editor opens a new tab in the chrome or safari browser and shows http://192.168.178.111:8123/endpoint/ui with response 404: not found. So no dashboard is shown.
For a test, I deleted flows.json to get an empty editor, then created a ui button, but same result: 404
Well, for starters, you seem to be running Home Assistant so not sure if that is having an impact. You've not shared the Node-RED startup log so we can't see all your settings. But the URL you shared has an extra level in it, /endpoint/ Not clear if that comes from Node-RED's settings or HA.
I have exactly the same problem. I am using node-red v3.1 on Home Assistant HASSOS. Everything is the latest version. When I try to access the node-red dashboard, running under Home Assistant the URL is http://192.168.1.98:8123/endpoint/ui. Whereas if I type in http://192.168.1.98:1880/endpoint/ui/ the dashboard is accessed correctly. This behavior has been the same for a few HA and NR upgrades. I suspect it is a HA issue rather than node-red since Home Assistant is targeting the wrong IP address, the /endpoint/ui is correct. In Home Assistant port 8123 is the base address for Home Assistant. Unfortunately I do not know how to change the dashboard address in HA, assuming it is a HA issue