I even tried to listen to foreground/background changes and force reset the theme. However it seems that the value of prefers-color-scheme never changes from the one that the PWA was launched with. The only way to change it is to kill the app and start again.