Hi Thibault,
I had a similar problem with my a6. I had to unlock it via the drivers door and again if I did not do it fast enough the alarm would go off. The car ended up going to an auto electrician and the drivers door lock mechanism had to be replaced. It cost me £120.
I deffo think it has nothing to do with your key as the symptoms are the same as mine and I did not have the keys replaced or re-coded. (or they weren't re-coded to the best of my knowledge when it went in for repair).
Hope iv helped.
Cheers
Steve