Assistance troubleshooting code to redirect upon form submission

I’m attempting to update a non-profit website to the new v2 forms. The following code is intended to redirect sponsors to a specific page upon submission based on their selections. It runs with no errors, but does not perform the redirect. Similar redirect code is running without issue on the old form version which uses element ID for the input fields rather than the newer field key. What am I missing? Any assistance is appreciated!

// Velo API Reference
import wixLocationFrontend from “wix-location-frontend”;

$w.onReady(function (){
$w(“#form6”).onSubmit((event) => {

// Extract field values using the event.fields array
const fields = event.fields;

// Define variables
// Types (dropdown): Monetary, In-Kind, and Monetary & In-Kind
const selectedTypeField = fields.find(f => f.fieldName === “sponsorship_type”);
const selectedType = selectedTypeField ? selectedTypeField.fieldValue : null;
// Value (dropdown)
const selectedValueField = fields.find(f => f.fieldName === “total_value”);
const selectedValue = selectedValueField ? selectedValueField.fieldValue : null;
// Payment Method (radio button): One Time Online Payment or Cash/Check
const selectedPayField = fields.find(f => f.fieldName === “payment_method”);
const selectedPay = selectedPayField ? selectedPayField.fieldValue : null;
// Monthly Payment (radio button): Monthly Online Payment
const selectedMPayField = fields.find(f => f.fieldName === “monthly_payment”);
const selectedMPay = selectedMPayField ? selectedMPayField.fieldValue : null;

// Selecting Type “monetary & in-kind” results in 4 and “monetary sponsor” results in 5
let MyNum = 0
if (selectedType === “Monetary Sponsor”){MyNum = MyNum+1};
if (selectedValue === “$750”){MyNum = MyNum+4};

// Redirect for one time online donation
if(selectedPay === “One Time Payment Online”) {
wixLocationFrontend.to(“/sponsorshippayment”);
}

// Redirect for monthly online donation based on Type field
else if(selectedMPay === “Monthly Payment Online”) {
switch (MyNum) {
case 5:{wixLocationFrontend.to(“/annual4”);}
break;
case 4:{wixLocationFrontend.to(“/annual3”);}
break;
default:
break;
}
}
})
});