In SPK there were 5 NPCs stacked on top of each other, so it was impossible to kill them all before I was killed. Went back, finished the mission, and my old rifle was there on the floor. Picked it up and it returned to my inventory with all of its attachments. Who knew!