It would be very reasonable to ask for adjustments due to your appointments (eg reducing the number of days you're in the office because of the impact of travelling, covid exposure etc). My husband has done this through formal arrangements with his line manager (no required in-office days for the final 2 months of pregnancy) and I had informal agreement with mine (caveat: we are both civil servants so there are policies in place and processes to follow if LM is being unreasonable/difficult about appointments etc, HR support etc).
It could be worth pitching it to your boss as 'if I can have flexibility on the number of office days then I can work up until my current finish date, otherwise for my and baby's health I will need to finish sooner' in other words your boss will need to sort out cover sooner than he expects
If you do want to bring this up with your LM then Maternity Action has lots of information about rights
https://maternityaction.org.uk/advice/health-and-safety-during-pregnancy-and-on-return-to-work/
But depending on your org and what type of HR support it has you may not be comfortable doing that.