Mwan3 not reverting back to main wan

You would want to create a second wg_iface with a different source port.

Unfortunately, you will need to create some custom firewall rules, because mwan3 won't handle rules for ip addresses that have a static route, which is added by the wireguard script.

You could add something like this to your /etc/firewall.user (warning, untested code)

#!/bin/sh
. /lib/functions.sh
. /lib/mwan3/mwan3.sh
. /lib/mwan3/common.sh
config_load mwan3
mwan3_init

function wireguard_ipt_rule ()
{
  local id interface endpoint sport
  interface="$1"
  endpoint="$2"
  sport="$3"
  mwan3_get_iface_id id "$interface"

  $IPT4 -I OUTPUT -d "$endpoint" -p udp --sport "$sport" \
        -j MARK --set-xmark "$(mwan3_id2mask id MMX_MASK)/$MMX_MASK"
}
wireguard_ipt_rule wan 185.XXX.XXX.XXX 51820
wireguard_ipt_rule wwan 185.XXX.XXX.XXX 51821