Looking on the Angular GitHub #59602, numerous issues related to HMR seem to be fixed in 19.1.3 (framework) and 19.1.4 (cli)
Can you update to those and see if the issue is fixed?