It's the battery in the fob as Manu suggests. It's exactly the intermittent behavior I started seeing on mine... replaced the battery and all is well.
As far as the distance, I guess once it's started it will go until you turn off the engine....
in my son's MKS he started it, got out, put his fob down in the garage, got back in and drove across Phoenix.... then discovered no key fob when he couldn't lock it... I had to take him his key fob so he could stat it after work.