First of all, don't worry (yet). No one gets in trouble because a paper got rejected. If it had been retracted, that would be a different story.
Secondly, I would be slightly cautious on coming to the conclusion right away that this was misconduct. Work builds on old work. My latest manuscript was sent back because it didn't provide a proof that was 95% identical to a now 40 year old proof. If the paper is genuinely attempting to present published work as novel work (without mentioning that it was ever done before), that's certainly an issue. But if it's spends 80% of the paper saying "here are the things leading up to our contribution", that's fine. In my case, I resubmitted my paper with the proof, along with saying "this proof follows a nearly identical form as ...".
Finally, if you still feel that the work is, in fact, attempting to pass published work as novel, now you have yourself a situation. There's not really a nice way to handle it, but perhaps you could begin with saying "what do you think of the reviewer's comments about the work not being original?" If they do not give you a satisfactory answer, you can say "I'm sorry, but I don't feel comfortable putting my name on this work". As uncomfortable as that will be, the good news is that they cannot put your name on without your approval. Telling the group that you don't want your name on the paper will very likely burn a bridge, but it sounds like you may have more concerns by keeping that bridge intact.