Thanks to this post by alex8088 I discovered that:
electron-vite is hard to intercept. It is recommended to use electron-vite preview command to test in production mode when you need to test this method.
RunningRun electron-vite preview instead of electron-vite dev -w and app.relaunch() works fine. Or did for me anyway. Thanks Alex