Here’s the part of the script that caused the issue:
https://openwrt.org/docs/guide-user/services/vpn/zerotier
uci set firewall.@forwarding[-1].dest='vpn
The single quote at the end is missing. It should be:
uci set firewall.@forwarding[-1].dest='vpn'