Why does setting the LinkedSource not work?

I have a script in ServerStorage, and I uploaded the script as a model

Intuitively these options should behave the same:

game.ServerStorage.Script:Clone().Parent = SomePart
Instance.new("Script", SomePart).LinkedSource = ScriptAssetID

However the second option does not work and the script does not execute

How should I properly link a scripts source?

LinkedSources have been removed for a couple of years now. You should use packages instead:

How would I use a package in this context? How would I load a script from an asset at runtime

You would have to create a ModuleScript with the code you want, publish it to the website, and make it public. Then from a server script, use the require function with the published ModuleScript’s AssetId.

--example
local module = require(56864785)

Another way to load scripts at runtime would be to use the loadstring function. In order to use it, you’d need to enable the property under ServerScriptService. loadstring also only works on the server:

loadstring("print(\"Hello World!\")")()

What if I need to parent a script to a part and I need it to run by itself?

The only way to achieve that would be using InsertService for a published script and insert it into the game. The downside of this is that the model needs to be either uploaded by Roblox or owned by the game creator.

You can’t change the source code of any pre-created scripts unless you’re using a PluginScript, but those only run in studio

but it creates an empty model named ToolboxTemporaryInsertModel, it automatically creates that model when you insert a free model that contains scripts

What are you referring to? I just tried the require and InsertService method and no such instance is created?

there is an empty model named ToolboxTemporaryInsertModel which creates if you use the toolbox to insert a model with scripts

What does the Toolbox have to do with the post though? Neither me nor the OP ever mentioned it.