PIR motion sensor connected to Arduino sometimes does not detect a repeatable trigger
From your description it seems that you have a motion sensor not a presence sensor - or at least that's the way it's configured.

Figure 1. A PIR motion sensor has a pair of side-by-side PIR sensors in reverse-series connection sense motion while giving high immunity to changes background radiation due to temperature changes. Image source is modified by me with original image from MakerGuides article.
Here it becomes clear that due to the reverse-series connection that walking into the purple detection zone would generate a positive going pulse and walking into the orange zone would give a negative going pulse. Standing still inside or outside the sensing zones results in zero output.
According to Components101 there are two modes.

Repeatable(H) mode
In Repeatable(H) mode the output pin Dout will go high (3.3V) when a person is detected within range and goes low after a particular time (time is set by “Off time control” potentiometer). In this mode the output pin will go high irrespective of whether the person is still present inside the range or has left the area. The sensitivity can be set using the “sensitivity control” potentiometer


Non- Repeatable(L) mode
In “I” mode the output pin Dout will go high (3.3V) when  a person is detected within range and will stay high as long as he/she stays within the limit of the Sensors range. Once the person has left the area the pin will go low after the particular time which can be set using the potentiometer. The sensitivity can be set using the “sensitivity control” potentiometer.

Try configuring for &quot;&quot;I&quot; mode.