Is there a bug with find or contains in Arrays, Sets or Maps?

well for me it worked when i did the test normally like just a array with two things and finding if they exists. however doing the same with inventory causes this same thing to occur. i basically check if the item already exists but it just make the condition false. i feel like something maybe wrong but ill try on it later cause it might just be a problem on my side