Well mystery solved.....

The new proximity sensor was faulty!! It appeared to be working fine but was intermittently causing an active state, luckily enough I have a few sensors in the spares cupboard. New sensor fitted and all good.