Send Invoice to Different Email Shopify Flow

That is a problem with your Run code step. I suspect that part where you assign it to matches[1] is actually undefined. Try matches[0].