If it "works" in some environment, it's likely due to a custom extension or monkey patching.
In Pandas 2.3.1, the correct way to shuffle a DataFrame is:
df = df.sample(frac=1).reset_index(drop=True)
df.shuffle()
is not part of the standard Pandas API.