This error / bug does not occur in version 1.7.0.
To reproduce:
from arcgis.gis import server
from arcgis.features import FeatureLayer
gis = server.Server(serverAdminEndpoint, username=username, password=password, verify_cert=False)
fl = FeatureLayer(restrictedFeatureLayerUrl, gis=gis)
features = fl.query()
The last line generates a JSON Decode error.
I've tried various parameters in the fl.query (e.g., as_df, outFields, returnGeometry, etc. etc.) and nothing seems to work. This code was working as 1.7.0, and when I downgraded by arcgis version to 1.7.0 on the same environment that had been generating the error, the code worked.