Looks like the match bracket heuristic breaks in certain cases. This is most notable in the following example doc which contains valid C code. Not entirely sure what it is about this specific example that causes the wrong brackets to get highlighted in some cases but thought I'd flag here since it is potentially indicative of a bug.
See gif:

Repro here (lines 52-65 of the doc are perhaps most relevant) https://replit.com/@SergeiChestakov/cm-bracketmatch-bug