Hide navigation from one entry but not others
This line:

{% set hideMenu = craft.entries.section('mysection').showMainNavigation('not 1').one() %} 


will return the first entry that it can find in the section 'mysection' that has showMainNavigation off. So as soon as you disable it for one entry, hideMenu will 'return' true, whichever page you're on.

So to fix this, if mainEntry is your current entry, then replace the line by:

{% set hideMenu = mainEntry.showMainNavigation %}