Have not tried JackCom or Headset Toggle yet, but have reset my Nexus 6p several times,
First scenario: just installing minimal amount of apps - with default + Google Inbox, Facebook and Instagram I still get the problem (no sound whatsoever from speakers, but sound from jack & bluetooth) after 1-2 days.
Second scenario: Now only trying factory reset and not a single app installed - running 24 hours, sound is still working.
Also - another side issue I've had, has been a short ½ second "squeelch" sound (white noise kinda) before any output to the speakers from any app. (but with previous setups with custom apps installed).
Hope this might help us troubleshoot this.
Rgrds