The ansible_local var is not being populated when using the setup module to gather custom facts on windows
According to documentation:

NOTE - For windows clients, the results will be added to a variable
named after the local file (without extension suffix), rather than ansible_local.

According to your example it should be in ansible_foo, but take into consideration that the files in the path must be PowerShell scripts (with extension .ps1) so maybe foo.fact wasn't actually executed.
Hope it helps.