It seems that routerOs contains a bug.
For the old wifi which support only 2 Ghz. The next script constuction works incorrect:
/interface wireless set [find default-name=wlan1] band="5ghz-a"
:log info "wlan1Support5 true"
:log info "wlan1Support5 false"
The construction must log 2 strings for this case. But it didn't lead to :log info "wlan1Support5 false"
"on-error" case seems not to be executed which is 100% bug.
The attempt to assign the 5ghz-a to the old 2 Ghz (b/g) wifi chips must lead to on-error executer.