I was in a similar situation to yourself in early June with an expected arrival time at the airport of 2300 but due to delay departing the UK, ended up exiting the airport about 1am. As far as I know, the airport closes overnight so no chance of crashing out in the lounges there.
I had previously booked a place in Lavacolla which is 4km from the airport and arranged for our late check-in. I ruled out the albergue there due to the lateness. From the airport there seems to be a flat fare of 21 euros to go to SDC or anywhere in between. It seemed a bit costly for such a short journey. The bus to Sarria passes through Lavacolla so it was just a short walk to the bus stop in the morning.
As regards booking, I used the monbus.es website as others have recommended. I did have to try a couple of different browsers to be able to enter the date correctly. The rome2rio website would list the buses but not allow any further interaction to book etc.
The first direct bus to Sarria leaves SDC at 1100 and the airport at 1115. So it is a long wait if you do stay at the airport. You can set off earlier, 0700 or 0900, if you go to Lugo first and change there. For me, staying at Lavacolla worked well though it did mean a late start to walking on the Camino the next day.