Personally, I am against mods automatically altering vanilla stuff like this. It just leads to mod conflicts and confusion.
Mods should let the end user or modpack developer decide, e.g. by providing an optional datapack.
Anyway, you can see your issue if you click on datapacks in the create new world screen.
The forge mod which contains the vanilla recipe is above your mod in the list. So it won't use your recipe.
If you switch the order it will use your recipe.
The way this works looks backwards to me - but I might be reading it wrong?. I haven't looked at this code before.
See ServerLifecycleHooks.serverPackFinder()
It takes a list (really a LinkedHashMap) of mods in dependency order and adds them one by one to the datapack list at the "BOTTOM".
This means the datapacks will be in reverse order of the dependencies?
I would expect it the other way around so a mod that depends upon another mod can override the dependee's resources.
In your case, that would mean your mod would appear above forge since it depends upon it. But doesn't look like this is how it works currently.