The logic of the custom realpath function in metadata::loader was incorrect, but the logic in util::fs was correct. Closes #13890