Why does a semicolon go missing from output when inserted directly after code expression?

from the docs

If a character would continue the expression but should be interpreted as text, the expression can forcibly be ended with a semicolon (; ).

Scripting – Typst Documentation.

So writing #{ ...};, the semicolon directly after } is interpreted as the expression termination character.