One small regression case for the set-based rewrite: put a row with "severity_level": " " in the test data. The original NULLIF(BTRIM(...), '') predicate excludes it, but the rewrite normalizes it to an empty string, which satisfies severity <> 'NORMAL'. If blanks should be excluded, use NULLIF(UPPER(BTRIM(payload_json->>'severity_level')), '') in both UNION ALL branches.
I work on SqlOtter. On a small fixture, I’d pin the original query result and compare it with the rewritten result in the SQL Editor. Keep the entire fixture in the loaded results so the comparison includes the blank-value case.