Why does REGEXP_REPLACE concatenate with a previous result?
It's a known bug, fixed in 8.0.12.


  REGEXP_RELACE() results from one result set row could carry forward to
  the next row, resulting in accumulation of previous results in the
  current row.