The general organization of how a verb distributes its semantic roles is called "argument structure" (this is part of the more general field of inquiry called "lexical semantics"). It is very common for verbs (especially those with 3 or more arguments) to display alternations. The most commonly cited of these is the so-called spray/load alternation (because of two verbs that show it). Here are examples with "spray"
(1) John sprayed paint on the wall
(2) John sprayed the wall with paint
These two sentences are approximately equivalent in meaning. Levin published a book called English Verb Classes And Alternations: A Preliminary Investigation, which consists of a list of English verbs and which of these frames they can appear in. She has a ton of other work on this topic, some of it co-authored with Rappaport Hovav.
In your specific example, "assign" and "set" are displaying different behavior. First I would point out that these sentences seem most natural to me in the context of computer programming operations. I would tentatively explain this by saying that "assign" treats its direct object (non-prepositional argument) always as a location, metaphorically speaking. "Set" on the other hand can apparently operate on metaphorical locations or metaphorical pointers. Why this is, and how it links up with other uses of these verbs, I couldn't really say.
(Also, as a native speaker of English "set X from Y" sounds quite unnatural. Technical writing is not always idiomatic, even when done by a native speaker.)