I could not find anything else out there on this use case!
But I have determined my runbook is getting stuck on:
$MSI = (Get-AzureADServicePrincipal -Filter "displayName eq '$automationAccountDisplayName'"
Pretty sure I got the $automationAccountDisplayName correct, so I am wondering what permissions I need to confirm exist, that perhaps you alluded to?