NSURL File ID

Previously, I successfully referenced a file in a Calendar event, by referencing its string URL.

use AppleScript version "2.4"-Yosemite (10.10) or later
use framework "Foundation"

use scripting additions tell application "Finder" to set Finder_Selection to selection as alias 
set theURL to current application's |NSURL|'s fileURLWithPath:(POSIX path of Finder_Selection)

--> (NSURL) file:///Users/akim/Desktop/Legion%20of%20Honor%202019-09-01.pdf

Calendar, recently, stopped retaining the path representation. Although it accepted a reference, it removed it after a second or two. Even so, Calendar retained its numerical id such as file:///.file/id=6571367.8766902296, after dragged a file document into a Calendar event window.

How do I correctly AppleScript NSURL’s method to retrieve a file URL ID?

NSURL has various representations:

For example this is the standard file path URL of the desktop folder

set desktopFolder to POSIX path of (path to desktop)
set desktopUrl to current application's NSURL's fileURLWithPath:desktopFolder

This is the file reference URL (file:///.file/id=…) representation taken from the file path URL:

set fileReferenceURL to desktopUrl's fileReferenceURL()

And these two lines get the standard file path URL back and also the string path coerced to AppleScript text

set filePathURL to fileReferenceURL's filePathURL()
set filePath to fileURL's |path|() as text

Thank you, StefanK. Your solution resolved the problem.