When using an environmental variable such as %localappdata% the custom rule does not work as expected.
The agent does not support environmental path variables.
Update the custom rule to utilize macros vs path variables. Common Path Macros
For example, instead of %localappdata% the path macro is <LocalAppData>