This is a common problem when saving ships with attached objects on them a simple fix is to add a DATA folder into the ATTACHED one. Lets say your ship has two turrets (We will call this MyGunship), and they are missing the data folder in the ATTACHED files. What you do is you save the turret as a ship into your blueprints lets say Myshipturret. Once that is done you go to your blueprint folder in the starmade folder, Open MyGunship, and Myshipturret in seperate folders. Now what you do is you copy the DATA folder in Myshipturret, and paste it into the MyGunship ATTACHED files, when you do that you then go into the ATTACHED DATA files and rename the files into what the folder is called like ATTACHED_0.0.0.0 then the next file you do the same but name it ATTACHED_1.0.0.0 and you go from there.
Now if you have diffrent things saved into your ship like a shuttle or something, you need to do the same thing but with a different file. Though I noticed that the order in which you dock something onto your ship determines the order in what the ATTACHED file is placed, like if you first dock a turret in game onto your ship and then a shuttle, the game will read that as ATTACHED_0 and the shuttle as ATTACHED_1.
Er, well its not that simple now that I take a second look at it, but do it enough times and it will be simple enough but its very very tedious and annoying to do every time you save the darn thing.