When the printer retracts the filament, does the filament at the location you want to place the sensor go backwards?
If I understand your image, it looks like the filament will not go backwards.
That means that if the sensor measures retraction, it will not properly measure retraction.
I don't know anything about this sensor, so I don't know if it measures both extrusion and retraction.