Based on the images you provided, the code worked as expected.
1. You selected the Test Plan Folder - Subject\TEST\Test_1
Therefore, that folder path (excluding Subject) would be recreated in the Test Lab, which is exactly what it did in creating
Root\TEST\Test_1
2. The code needs to create a test set entity to put test instances in. It names the test set to match the lowest level folder.
Therefore, in the Test Lab folder Test_1 it created a test set named Test_1.
3. It created a test instance in the new test set for each test in the Test_1 folder.