I don’t suppose that the flat being the only property I owned, despite me not living in it, helps me? (I was renting the house I lived in)
Nope. You can maybe move in to have it as your primary residence, and then can get 18 months relief (edit – looks like its only 9 months from 2020). Read the link I posted, everything is very clear.
You invested money in an investment (a property) and now you now quite rightly have to pay tax on the capital gain.
Whether the discord between the treatment of B2L/second homes and primary residential property is fair is another query.
Personally I would be in favour of taxing all property gains inc primary residential (yes, I own property) but I appreciate this would be an absolute vote killer for any party suggesting it.