Good advice posted so far and not much to add , if it is the door lock mechanism that is faulty (a very common problem with the A3 and Golf etc that share the same parts) then get it fixed sooner rather than later, if it fails totally in the door closed position then you have to butcher the door card panel to open the door and get the lock out!
The offside rear lock on my own car failed about a month ago and it’s an easy fix , about 30 mins to replace , although you will need or have access to a VCDS cable to ensure the new lock has the same software programming as the old one.
It’s generally accepted that these locks are of poor quality and will eventually fail with time , I had been wondering when I would begin to get lock hassles and am certain that at some time my other 3 locks will play up!
I believe the actual issue is that a micro switch within the mechanism fails and if you’re brave enough there are YouTube videos on how to dismantle and repair these locks......
One question relating to your boot lock; does your rear wiper work OK?
The rear wiper has a design flaw in that the washer fluid pipe goes through the body of the motor itself and in time can leak and corrode the internals , sometimes causing washer fluid to leak out and drip onto the boot lock causing more problems, so eliminate that as a source of trouble before replacing a boot lock......
When the wiper motor has sustained terminal damage it often develops a life of its own , operating without it being switched on or parking the blade at funny angles and not in the normal stop position.
When you know about this problem it’s amazing the numbers of A3s etc that can be seen driving around all with rear wiper blades parked at odd angles, they’ve all got naffed wiper motors!
The only solution in these cases is a new rear wiper unit, only fit a Valeo motor as these are the factory brand and take about 10 mins to fit with 3 bolts holding it in.