I guess that you copied from the Finder then select a text window to apply the script.
When the script restores the clipboard record it does that in the Text Editor.
I wrote a bare script to look at the process behavior.
To work in the best conditions, I decided to encapsulate the instructions related to the « complete » clipboard in a tell "Finder" block.
tell application "Finder"
set clipboardAsRecord to the clipboard as record
(*
{«class furl»:file "Macintosh HD:Users:yvankoenig:Desktop:mailboxes.txt",
«class ut16»:"mailboxes.txt mailboxes 2.txt",
«class utf8»:"mailboxes.txt mailboxes 2.txt",
Unicode text:"mailboxes.txt mailboxes 2.txt",
string:"mailboxes.txt mailboxes 2.txt"}
*)
end tell
tell me to set clipboardAsText to the clipboard as text
set the clipoard to "azerty"
tell application "Finder"
set the clipboard to clipboardAsRecord
end tell
delay 1
tell application "Finder"
the clipboard as record
end tell
(*
{«class furl»:file "Macintosh HD:Users:yvankoenig:Desktop:mailboxes.txt",
Unicode text:"mailboxes.txt mailboxes 2.txt",
string:"mailboxes.txt mailboxes 2.txt",
scrap styles:«data styl01000000000010000E00030000000C00000000000000»,
«class utf8»:"mailboxes.txt mailboxes 2.txt",
«class ut16»:"mailboxes.txt mailboxes 2.txt"}
*)