Add any() or all(), if this is work.
Snippet:
if df['twitter'].str.lower().str.contains('windows 11').any():
return 'windows 11'
elif df['twitter'].str.lower().str.contains('windows 10').any():
return 'windows 10'
return 'windows 8 or older'