Reproduction steps
Call git_worktree_lookup with a name that does not match the internal name of any existing worktree.
Expected behavior
An error code of GIT_ENOTFOUND should be returned.
Actual behavior
An error code of GIT_ERROR is returned instead.
Version of libgit2 (release number or SHA1)
Current main (22f3825 at time of writing).
Operating system(s) tested
macOS but should happen on any OS.