The starter solenoid contactors are know to fail, which incidentally are easy and cheap to replace, in the UK anyway.
When the contactors begin to fail, then the starting gets random, sometimes starting, sometimes not. The starter solenoid energizer connection can also corrode, which can lead to random starting.
I suspect your starter had failing solenoid contactors, which was giving you the problem.
It's a shame you had to change the whole starter, for a $15 solenoid contactor set, but if you don't know they exist, fitting them isn't even an option.
If the replacement starter has solved the problem, then that's the job done. The starter contactors are the weak part in the system, so nothing else should fail. I've never heard of the gear position sensor failing (wiring can though), but if the dash LCD is displaying N or P, then it's nothing to do with the gear position sensor anyway.