Why GridSearchCV returns nan?
By default, GridSearchCV provides a score of nan when fitting the model fails.  You can change that behavior and raise an error by setting the parameter error_score=&quot;raise&quot;, or you can try fitting a single model to get the error.  You can then use the traceback to help figure out where the problem is.
For the LogisticRegression, I can identify the likely culprit: the default solver is lbfgs, which cannot handle L1 or ElasticNet penalty.  Use saga.
I don't immediately see an issue with the XGBoost model or parameters.  Get the error traceback using the first paragraph, and search/ask that as a separate question if needed.