Pi gpio does not function properly

Hey I am using pi gpio as binary sensor,
Settings is pull up… so I will be able to attach ground pin to switch.
Sometimes switch remain stuck.
The purpose is to have input for scene.
Is this matter of the pi or home assistance code?

You don’t say if you have read it, but there is a lot of discussion here about this

Yes… but suggested solution is not working , i have tired pull up resistor and pull down topology …

same issue…
GPIO actual status is OK , that means the GPIO status is not updated for some reason …