I have decided to recode the Automator Quick Action to avoid using the Run Applescript action. What I have written will still pop a dialog stating that Finder wants to control the Preview application. Open the panel below before you click the OK button on that dialog to the Automation section. Then click the OK button and you will see Preview added below System Events.
Note, I already had System Events in here, and you may be prompted with two dialogs when first running this Quick Action: 1) Finder wants to control System Events, and 2) Finder wants to control Preview. Each click of the OK button will add its permission as shown below.

Now, when I select a PDF in Finder and then choose Quick Actions > Use PDF Thumbnails, it works for any selected PDF, just as planned. I changed the name of the Quick Action when I saved it.
This time, I am using Automator's Library > Utilities > Run Shell Script action, and NOT Run AppleScript. Here is what the finished Quick Action looks like:

When you drag the Run Shell Script to the workflow window, and set the shell to /bin/zsh and Pass input: as arguments, you will see new content appear in the window. Select that content and backspace to remove it. Replace that run shell script content with the following code:
: <<"COMMENT"
Select PDF document in Finder and then right-click and choose Quick Actions > Use PDF Thumbnails.
COMMENT
function show_thumbnails () {
osascript <<-AS
use scripting additions
tell application "Preview"
activate
open file POSIX file "${1}" as alias
tell application "System Events"
tell process "Preview"
set frontmost to true
click menu item "Thumbnails" of menu "View" of its menu bar
end tell
end tell
end tell
return
AS
}
show_thumbnails "${@}"
exit 0
Then save, and name your new Quick Action.