Boeing 767's, 747Classic and 747-400 all require an energized solenoid to unlock the gear lever, ZFT. i.e. In flight, it is energized.
An electrical failure would most likely de-energize the solenoid, re-locking it. Manual override will get the gear up if it is down. I seem to recall, however, it's not necessary to push the override button/plunger if you are moving the lever from UP to OFF or DOWN because of the geometry of the mechanism.
I have no explanation for the compass behaviour.
Rgds.
NSEU>