I think you are probably confusing a few things.
What I'm more or less sure about (although I haven't used C2 for a long while) is that the start/end of layout triggers in an expected way.
// start game
on start of layout
every tick
....
on end of layout
// change to other layout
on start of layout
every tick
....
on end of layout
etc
now, for your problem with countdown, it doesn't look like a bug really. When you use a digital stopwatch and start it, the first thing that will happen is then millisecond going down, so instantly 90seconds becom 89seconds and some miliseconds
if your algorithm is something like:
countDown = 90
every tick
-> countDown -= dt
-> set Text to floor(countDown)
you'll probably not see 90, and that's ok
now for the hp problem, I can be that you lose the value of the hp after changing layout, so it's logical that the value saved would be 0
I don't have enough details to be really conclusive, but if it's something like
if hp <= 0:
hp += 50
go to layout GameOver
// in layout GameOver
on start of layout
save hp to local storage
and your hp saved is 0, it might be that either hp isn't a global variable (local variable of the same name?), or, that something else is touching it before you're saving it
also, it's weird that you save the hp in the other layout, it looks more consistent to save the variable at the same place you update. But missing too much context to be really sure.