In the new code, do you have empty inside the fetchCurrent or only in return after the semaphore wait? Try to put your ssidResult to some ref box.
Also try to wrap your NEHotspotNetwork.fetchCurrent inside the DispatchQueue.global().async {