With MacOS 11.3 the problem is still there. Messages unchanged.
Post
Replies
Boosts
Views
Activity
With MacOS 11.4 the problem seems to be solved now.
red_menace,
according it's info.plist Preview is scriptable and has no scripting dictionary. But I think, a missing dictionary is not relevant here. You can exchange Preview with TextEdit and you will get the same result: Both tell blocks work when executed from ScriptEditor or run with osascript using the scpt-file. But when I osacompile the script's text, the second tell block throws error -1728.
You wrote "application needs to be specified at compile time though", I do not understand "though" in this context (sorry, I am not a native english speaker).
Not hard-coding the application and using a string variable with tell application works and is accepted by both ScriptEditor and osacompile. Accessing the front document succeeds in both tell blocks.
You asked what I am hoping to accomplish: Well, the real script is part of an Alfred work flow (see https://www.alfredapp.com/help/workflows/actions/run-nsapplescript/) and asks System Event for the currently active application and from there it tries to get the file path of document 1 via property path oder file.