The authorization code is invalid or has expired, okta_post_message, code with backslash

Solved this.

It turns out the \ is actually specifying an escaped/encoded value. The \ is always followed by x2D so \x2D is an escaped/encoded -. If I simply replace the \x2D in the code with - the code works!