I encountered a similar issue with XGBClassifier and GridSearchCV. I tried the solution mentioned earlier—uninstalling and reinstalling an older version of sklearn (version 1.5.2 in my case)—but the problem still persists.