Maybe during the 2nd service the brake pads were replaced or the caliper has been taken apart and the thing was put together without the brake being pumped up again then this could explain the symptoms. You say the brake worked again after you used it again so that means that the pistons in the caliper probably were too far apart to have any effect.
I know the feeling that you had at the first moment. Once at a trackday I had to change tires from dry to rain because the weather was constantly changing. I was in a hurry because my session was almost starting, put the whole thing together, put on my helmet and gloves and got onto the track. First lap is slow, wanting to heat up tires, and at the end of the first straigth I squeeze the front brake and nothing happened. It is said that men can only do one thing at the time: I could do much more. I cursed, I prayed that I would make it, applied the rear brake, frantically pumped up the front brake, shifting down and braking on the engine and try to manage the curve. One of those moments.... It has taught me to be careful with brakes and not to hurry some things.
To come back to your experience: you may have used the front brake only and not noticed that the rear brake was not pumped till you did. So likely not your bikes fault but the mechanic's. Give him a stern look next time you see him......