Fix escaped text replacement

What does this MR do?

Fixes replacement of escaped text in comment boxes on error.

Are there points in the code the reviewer needs to double check?

Maybe?

Why was this MR needed?

Because the behavior was infuriating :) .

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#37724