I'm sure glad Harley wasn't the designer and vendor for all those keyless systems being used by various automotive companies these days. Not only wouldn't the car start, but the truly keyless ones wouldn't even let you open the door and get in. I'm pretty certain the auto folks aren't having these problems, because we all know how quickly such failures would become the lead story on the nightly news if they were occurring. Not to mention the lawsuits.
More than a few people reported issues in the first couple years after the introduction of the buttonless fobs by Harley. I know some felt it was related to electronic interference, since the problem seemed to occur only when they were in a particular area.

Next time this happens, see if you can enter your personal security code and get the bike to respond that way. That might help tell you if it really is a fob related problem, or some other electrical gremlin. Either way, I'd suggest getting it on record with the dealer and H-D that you are having this problem.
Jerry