The notify services for the file integration now require that the file path is an allowed path. You should check the accessed file is in the allowlist_external_dirs to ensure your automations keep working.
(@jbouwh - #116861) (documentation)
Try to setup by the ui, Settings, devices, add integration, file
Where in the above document does it ask you to do that (apart from the allowlist)? I suspect you’ve pulled that code from an out-of-date forum post or so-called “tutorial”.
Edit: to be fair, the update to UI configuration is new with 2024.6: