Session handling across timeframes can get tricky in Pine Script — syncing to a base timeframe and using timestamp checks instead of just session. isnew
might help.
Had a similar issue in another app (Honista APK). The new version broke session flow, but the old version worked perfectly. Sometimes going back is the fix.