What seems to be happening is that for some reason your code interprets the user request as a link rather than an append.
I can think of two schematics that could produce this fault, having taken a quick look at your code:
- The “append” interface button calls the link function or
- Something in the way the file is searched for and located in the library triggers the wrong if / else.
A third and less likely, in my opinion, is that the actual format of the file causes the problem. If this third is not true, you won’t find your answer looking at a file where the library append failed.
I suspect you can’t reproduce the error, because your code fault is about the library file and the path (case 2 above), rather than the file where they are appended. To make sure I’m sending both:
- A file from my library (a Chocofur free asset), pre-existing in 2.79 format
put this file in your library under “Furniture” category, “Chair” sub-category
Chocofur_Free_18_Fabrics.blend (737.8 KB)
- The destination file, Blender 2.8, where I tried to append it. I left the chair as a linked object (no transforms possible until you make it local)
DestinationFile.blend (919.5 KB)
The built-in Blender method is to make the object local (rather than linked) and there is a command just for that, as I mentioned previously.
I hope this helps