Copy elements from linked model - wrong location

Okay, I found another script which work correct.
Link: Batch copying elements from a linked file

But still I’m curious why previous script doesn’t work.
Where is the crucial difference?