The problem is not the length of the name. It seems that sometimes the device name on the AP and the device name in cnMaestro are out of sync. No indicatation on the AP or cnMaestro. When you push any kind of template change (in this case, cnMaestro URL) it changes the name to what it thinks it should be and forces a reboot.
Whenever template is pushed to device, cnMaestro also tries to push the hostname to device and if there is a change in hostname , device will go for a reboot. cnMaestro gets the device hostname only when the device is connecting for the first time, or reconnecting after reboot or cnMaestro url change. This is expected behaviour only.
2) Later the AP Device name is changed in the physical device to "AP #1 North" and is rebooted.
3) In cnMaestro, the lefthand device tree shows the correct "AP #1 North", however, in the Configuration page it still says "AP #1"
4) You push a template from cnMaestro to the AP and cnMaestro changes the device name back to "AP #1" and reboots the device. In this case we sent a template with a new cnMaestro URL to On-Prem.
Even if you change the Device Name in cnMaestro to match what is actually on the AP, it still reboots it when you apply.
Thanks for providing the steps to reproduce. The issue is reporducible only if the hostname contains the character # in it . Otherwise it is not happening . We will try to debug further from cnmaestro side and get it fixed.