I just noticed that WifiManager.WifiInfo.getBSSID() now returns 02:00:00:00:00:00 and that WifiManager.WifiInfo.getNetworkId() returns -1 even with the ACCESS_COARSE_LOCATION permission set.
It's interesting because it used to work great before. It seems that the problem appeared after an Android update.
The solution was to replace ACCESS_COARSE_LOCATION with ACCESS_FINE_LOCATION.