Issue
In LaTeX, you have to escape underscores, even in plain text context, as far as I am aware. This means that e.g. $\text{some_text}$ would be incorrect and likely not compile, at least not in Overleaf, while $\text{some\_text}$ would be.
However, in the Assistant, when formulas are enclosed in single ($...$) or double dollar signs ($$...$$), this is not the case and $\text{some_text}$ is displayed as some_text, while $\text{some\_text}$ is displayed as some\_text. This can be seen in this example thread.
This thread shows that e.g. Claude escapes underscores in normal use, leading to improper rendering of the formula.
Interestingly, escaped underscores are sometimes rendered correctly, as can be seen in this thread. Please note that in the original prompt, I had assumed that escaping underscores within \text was incorrect. In this case, the part after "Not:" uses escaped underscores but is displayed correctly. I was not able to find a specific cause for this. Removing some parts of the answer had no effect, while removing other parts or larger sections did affect the rendering.
Expected Behaviour
Formulas inside the output should not include formulas that are displayed incorrectly, because of escaped underscores inside \text. I am unsure whether the use of escaped underscores in this way is intended, so it is unclear whether the issue is with e.g. Claude's output or the rendering.
Assuming the system prompt does not already include instructions regarding this, it should prevent outputs from including formulas with escaped underscores within \text. Outside of \text, it would likely make sense to keep escaping underscores enabled.
Otherwise, as is the case in the previously linked thread, escaped underscores should be handled like in LaTeX, meaning e.g. $\text{some_text}$ should be displayed as some_text.