I made a simple datapack with a recipe the same as the stone sword in vanilla, except it outputs a diamond. When vanilla is disabled, the recipe produces a diamond as intended. However, when I type "/datapack enable vanilla first" to re-enable vanilla, the recipe works as it does in vanilla, producing a stone sword. My understanding is that the "first" keyword in the command makes vanilla have the lowest priority, but from the results that doesn't seem to be the case. Whenever Vanilla is enabled in the world, it uses vanilla crafting recipes regardless of the datapack order.
To override the stone sword recipe, you should call the recipe
stone_sword.json
in theminecraft
namespace. Since you're not overriding it, both recipes are loaded, and the winner is not determined by the data pack on top