Escape room creation - error with HTML

Why do I get errors when I go on developing an app, it is so unpredictable. I get everything done, then when I ask to create an HTML file and make it self checking, highlight with green when it is correct and red when it’s not it just won’t work, no matter if I write it more than once or even if I ask Gemini to create the textual instructions in the improvement bar.

Is it better to delete what doesn’t work and then try to develop another day in the future or sometimes I undo the actions. You ask for something and it doesn’t do what you ask but it changes other things that were ok.