Hey I know it doesn't use the voice vlan info. What i'm saying is I can even remove the value in that scenario.
My 1st test was an access port with voice vlan removing.
Here is my change log with the changes you requested.
Show your script and we might be able to see what's going wrong.
1 creating access port with voice vlan
via API
PUT /api/v0/devices/****-****-****/switchPorts/5
old
{"number":5,"name":"test voice Vlan Update","tags":null,"enabled":true,"poeEnabled":true,"type":"trunk","vlan":10,"voiceVlan":null,"allowedVlans":"all","isolationEnabled":false,"rstpEnabled":true,"stpGuard":"bpdu guard","accessPolicyNumber":null,"linkNegotiation":"Auto negotiate","portScheduleId":null,"udld":"Alert only","macWhitelist":null,"stickyMacWhitelist":null,"stickyMacWhitelistLimit":null}
new
{"number":5,"name":"test voice Vlan Update","tags":null,"enabled":true,"poeEnabled":true,"type":"access","vlan":20,"voiceVlan":25,"allowedVlans":"all","isolationEnabled":false,"rstpEnabled":true,"stpGuard":"bpdu guard","accessPolicyNumber":null,"linkNegotiation":"Auto negotiate","portScheduleId":null,"udld":"Alert only","macWhitelist":null,"stickyMacWhitelist":null,"stickyMacWhitelistLimit":null}
2 changing to trunk port
via API
PUT /api/v0/devices/****-****-****/switchPorts/5
old
{"number":5,"name":"test voice Vlan Update","tags":null,"enabled":true,"poeEnabled":true,"type":"access","vlan":20,"voiceVlan":25,"allowedVlans":"all","isolationEnabled":false,"rstpEnabled":true,"stpGuard":"bpdu guard","accessPolicyNumber":null,"linkNegotiation":"Auto negotiate","portScheduleId":null,"udld":"Alert only","macWhitelist":null,"stickyMacWhitelist":null,"stickyMacWhitelistLimit":null}
new
{"number":5,"name":"test voice Vlan Update","tags":null,"enabled":true,"poeEnabled":true,"type":"trunk","vlan":10,"voiceVlan":25,"allowedVlans":"all","isolationEnabled":false,"rstpEnabled":true,"stpGuard":"bpdu guard","accessPolicyNumber":null,"linkNegotiation":"Auto negotiate","portScheduleId":null,"udld":"Alert only","macWhitelist":null,"stickyMacWhitelist":null,"stickyMacWhitelistLimit":null}
3 changing back to access port and removing voice vlan.
via API
PUT /api/v0/devices/****-****-****/switchPorts/5
old
{"number":5,"name":"test voice Vlan Update","tags":null,"enabled":true,"poeEnabled":true,"type":"trunk","vlan":10,"voiceVlan":25,"allowedVlans":"all","isolationEnabled":false,"rstpEnabled":true,"stpGuard":"bpdu guard","accessPolicyNumber":null,"linkNegotiation":"Auto negotiate","portScheduleId":null,"udld":"Alert only","macWhitelist":null,"stickyMacWhitelist":null,"stickyMacWhitelistLimit":null}
new
{"number":5,"name":"test voice Vlan Update","tags":null,"enabled":true,"poeEnabled":true,"type":"access","vlan":10,"voiceVlan":null,"allowedVlans":"all","isolationEnabled":false,"rstpEnabled":true,"stpGuard":"bpdu guard","accessPolicyNumber":null,"linkNegotiation":"Auto negotiate","portScheduleId":null,"udld":"Alert only","macWhitelist":null,"stickyMacWhitelist":null,"stickyMacWhitelistLimit":null}