I did the same thing in the second long qualifier in Brazil in 2014. I realised at the first control and knew that I could go back for a new map - the problem was that it was a 20-minute, 2.5km first leg. (As it turned out, our heat that year was sufficiently spread out that with 40 minutes lost, I might still have been able to sneak into the last A final spot with a good run after a restart, but the chances of having a good run in such circumstances would have been fairly minimal).
I missed punching the control on the shortest leg in the sprint qualifier.