My few months old Audi A4 developed this problem. Car would attempt to start three times with engine cranking whenever I pressed the start/stop button. It turned out to be bad fuel pump in the tank, it was completely rusted. Dealership said it happened due to bad fuel. They replaced the pump and the problem went away.
If engine is cranking but not starting then most common cause is fuel supply interruption. Since your car was attempting to start nonstop, ECM glitch could also be the culprit. Keyless systems are designed to make a few engine starting attempts in case of no start, mostly 3 times. But even with ECM glitch on non-stop starting attempts, the engine should have started if there was fuel supply. So if this happens again, check everything related to fuel supply: fuel pump, fuel pump fuse, fuel filter, etc - also get spark plugs checked.