Could be a faulty switch, or it could be that the fuel pump is on its last legs, and that toggling the switch jolted it back to life for a couple of minutes.
I had the fuel pump on my old Town Car fail (in 118 degree heat between Phoenix and LA; don't ask). Symptoms were exactly as you describe. Of course, that car was 15 years old and had 140,000 miles on it, so I forgave its fuel pump failure. To have it happen on a 3 year old Expedition is
S.