It looks like the problem you're having is nothing to do with the bookmark resolution, or the URL that you got from NSOpenPanel. When you save the bookmark, you are saving to the user's Documents folder (via applicationDocumentsDirectory() ). You don't have access to that folder, because you would need permission from the user (via NSOpenPanel) to access it.
If, in running your existing NSOpenPanel invocation, you (as user) choose the Documents folder, the bookmark save will succeed, because you're writing it in the folder that you got permission for. (If you chose a different folder, the save would silently fail, since you don't have any error handling.)
But now you've got a catch-22. You can't read the bookmark file back in a later launch, because to do so your app needs permission to read from the Documents folder, but it doesn't have that until after it's read the bookmark from there.
Instead, you should save the bookmark file in a location that's inside your app container, so that you don't need user permission to read or write it. You can use the Application Support directory (which you get hold of in a similar way to getting the Documents directory) for the bookmark file, or you can save the bookmark data in UserDefaults if you prefer.
For documentation on containers (and what's inside or outside), see here:
https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html
under the heading "Container Directories and File System Access".