There might be a case where your Anypoint Studio is not connected to Anypoint Platform to establish a connection with API manager for Auto Discovery. So disable the auto-discovery in locally for testing purpose or set up Anypoint Platform credentials in Anypoint Studio to have a proper connection for API Auto Discovery.
For Disabling,
Try to comment on the Auto Discovery XML config from Code and see how it works or not
Or pass the below VM argument in Anypoint Studio
-Danypoint.platform.gatekeeper=disabled
Note: Disabling is only for testing purposes.