A Processing Unit that has been undeployed remains in an UNDEPLOYED state although all instances have terminated. This is caused by one of the managers not being in sync with the others in order to get the event notifications.
A workaround would be to restart one of the managers that is out of sync.
restart of out of sync manager
Added reproduction test to sgtest suite