WAIT: Custom code inside basic text widget

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.

I noticed that its possible to include custom code inside the “basic text” widget.
One of our designs broke because of a piece of code that came along from Figma.

Is it not better/safer if custom code is not possible to run except through the “code” widget?
Otherwise I don’t really understand the use of all the signing of custom code.

Example:
<script>alert()</script> - inside a basic text widget gives an alert on the front end.