I've heard others talking about the gear selector has a parking switch that tells the Body Control Module the vehicle is in park.
This switch has had a Ford TSB Technical Service Bulletin sent out to all service departments at Ford dealerships letting them know about this faulty part.
Now I'm not saying this is the exact problem you are having, just a suggestion of one of many possibilities it could be.
Sent from my SM-G930P using Tapatalk