I just had this problem, and tried everything yesterday. This was what worked. Copied the yaml, deleted the automation, created a new and pasted the yaml. All in the UI, now it finds it.
I think I might have renamed the script once early on yesterday, that might have been the reason.
Thanks for you pointer!