Are you deleting the Macs out of the JSS as part of your imaging workflow? Because if you are, it's normal that they would fall out of any Static Groups. Once a record is deleted from the JSS, it gets removed from any groups and won't get put back in them unless done manually or with an API script.
If you leave records in place, when they get re-imaged they should land back in any previous Static Groups they were members of before being re-imaged. The JSS pairs the machine back up by it's UDID and knows its the same Mac.
If you are testing out DEP workflows and using pre-stage (making an assumption), could you just use a smart group that would look for anything that was enrolled using that pre-stage? That way, even if you do delete the object, it will auto-populate that smart group because it ran through that particular pre-stage.
You can create multiple pre-stages so you can test multiple DEP workflows using a smart group for each pre-stage.
ex.
Smart Group name: <PreStage> enrolled devices
Criteria: Enrollment Method: PreStage enrollment is <PreStage enrollment name>
DEP workflows can then be scoped to the smart group.
Cheers!
-Dan
Try using a Smart Group containing the serial numbers of your test devices.