The exact same thing happened when I switched from editing mode to reading mode. My formulas were then highlighted in yellow and not correctly formatted.
PDF export is closest to Reading view (and the light color scheme).
Can you paste the section with the problem (and just above it) here in a code block? Something seems wrong with the formatting if you are seeing the yellow error in Reading view.
"SYSTEM INFO:
Obsidian version: v1.8.9
Installer version: v1.7.7
Operating system: Windows 11 Pro 10.0.26100
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: Tokyo Night v1.1.3
Snippets enabled: 2
Restricted mode: off
Plugins installed: 3
Plugins enabled: 2
1: Git v2.31.1
2: Latex Suite v1.9.8
RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.