I would like to thank all for this question - as I was just setting up and connecting my filament out sensors using a mini-micro switch (tyipical endstop switch).
I didn't read anywhere about just using 2 wires - and having all three just wasn't working.
for polbofree … if it makes any difference for you - I had to disconnect (not use) my voltage-in wire (the middle one on the DuetWifi endstop) .. and just used the two outside signal and ground.
... anyway I hope you get your's working ... but - again thank you for the question and Dc42's response!
Dc42 - will your new optical/laser sensor use all 3 wires?