Links are fragile, and tools that generate them overpromise and under-deliver.
Yet, still, being able to access the file you want without obstruction is (very) useful.
The way I scratch this itch: instead of linking directly to a file, I created a shortcut that will look for the file.
Spotlight, on Mac and iOS, is quite good, and if your files are uniquely(ish) named, as most of mine are, then they will quickly be surfaced via Spotlight.
Plus, it doesn't matter if you move the file.
If you rename the file, then this won't work, so best to establish a naming convention and, to the extent possible, automate the naming.