I have no experience with astroquery, but this type of problem can commonly be solved with exception handling. My Python is rather rusty, but something like this should work:
table = None
table = Nist.query(lambda_min[i] * u.AA, lambda_max[i] * u.AA, linename=species[j], wavelength_type="vac+air")[["Observed","Ritz"]]
You can use SunPy, check the Retrieving and analyzing GOES X-Ray Sensor (XRS) data example. There it explains how to download data with a time range and if wanted selecting the GOES satellite number.
If you would like the raw data in csv format, then you can get it from the official archive for GOES data. There you can find full an average data in csv format ...
In Astropy, u.G represents a Gauss, not the gravitational constant. That's why you get the "A" in one of the error messages; it represents an ampere. To use the gravitational constant in your code, you need to use astropy.constants and replace u.G in your code with constants.G (or just add import astropy.constants as c and use c.G, if you prefer).
If you have not already, refer to this document. Section 14.1.1 provides the schema for gaiasource. You will note that there is no field with a name (eg: 'Alpha Centauri A').
I had queried Gaia data using the function below. GaiaDR2SourceIDs is a comma separated string (ID1,ID2,ID3,.....,IDn) for ID's to retrieve. ...