Mini PIR motion sensor

If I swap it for this one I don't have the problem.

I also use one of these mini sensors a few years ago didn't have this problem. I need the mini for size