Could it be you edited the entity id in the gui? I have had similar issues with automations. The entry in the yaml is originally equal to the entity_id. If one is changed, some parts of the system get confused because they wrongfully rely on both being the same.
If so, you can get around it by either renaming the entity id back, or change the entry in the yaml file so they match again.