It's all down to chronic under-resourcing of services, all services.
When requests for appointments, scans, tests come in, they all have to be triaged, some are clearly going to be life and death urgent, and some are completely routine.
Because the system has no spare capacity, and targets to meet, for example a 2 week wait for urgent cancer referrals, to a service that sees new referrals, follow-ups and routine cases and they're expecting say 20 referrals per week, that means they have to keep 20 slots open, all the way up to 2 weeks before the clinic / radiology slot. Once you get to within 2 weeks, you may find there are unused slots which can then be filled at short notice, hence the letter arrives after the appointment or other such nonsense.
It would be great to have a system that allows people to book and choose an appointment - but in reality it's virtually impossible to administer electronically - for example my clinic runs on a monday afternoon, apart from bank holidays, the days every 12th week I cover another service, unless the previous week was a bank holiday, then its 13th week, annual leave, study leave, departmental meetings - all of which can change up to 6 weeks before the appointment. Even with 5 real humans administering it all, it still goes wrong more often than I'd care to count - patients turning up to clinics that aren't running, or patients needing to see me, and only the registrar is there - again.... No electronic system is going to be able to cope with that.