I just had the same or a similar problem.
The virtual ports in APCC were Com20, Com21 and Com22. The ASCOM Driver is configured to use Com20. Yesterday the ASCOM driver could not connect to APCC. The driver configuration showed Com20 but the APCC configuration showed no virtual port. Com20, Com21, and Com 22 were not listed in the dropdown box where you set the virtual ports so I could not set these anymore.
The Devicemanager showed under COM / LPT three virtual com ports (20, 21 and 22). These ports were being installed independently of APCC as these appeared after a reboot without starting APCC. I used the Devicemanager to uninstall these virtual com ports. Afterwards APCC would see these ports as being available again and I could select Com20, Com21 and Com22 as virtual ports. The ASCOM driver connects and is happy again.
It looks as if some Windows or another install routine has seen these ports and decided to install a permanent driver / setting for those ports (I use an external USB hub). So APCC is seeing Com20, 21 and 22 as already taked ("in use") and thus the error.
Maybe you have a similar issue, Jerome.