Sometimes we have old scripts or automations that were created in yaml, but can now be edited in the gui. Or some portion of a new script or automation requires yaml (or jinja…)
Whenever you just open the script or automation in the gui - even accidentally - let alone save, close, and re-open, it removes all comments.
If I put a comment in my code, it’s because I wanted to remind myself of something - perhaps years after I originally wrote it. Just leave comments alone.