pd.isnull() behaves differently depending on the type of input:
pd.isnull('nan') is False because 'nan' is just a string.
pd.isnull(float('nan')) is True because it’s a real NaN float.
In a DataFrame, if a column contains 'nan' as a string, pd.isnull() will treat it as a regular value. If you convert the column to Float64, pandas will try to coerce 'nan' to np.nan, which is treated as a missing value.
Example :
import pandas as pd
import numpy as np
df = pd.DataFrame([['1', pd.NA, 'nan']], columns=['a', 'b', 'c'])
print(pd.isnull(df['c'])) # False
df['c'] = df['c'].astype('Float64')
print(pd.isnull(df['c'])) # True