I've worked out what the problem was here. I had the .alert(isPresented:) on the Connect Sheet but of course, the connect sheet was itself set to hide (via the 'show' boolean). This meant that the alert only became visible if I re-triggered the view to allow me to login again.
Before, the boolean was set correctly but there was no view to show the alert. I've fixed it by attaching the alert to a view that is permanently visible.