why is it incorrect to use den where the det is? Shouldn't it be den because it is modifying a masculine noun?
If you haven't mentioned the noun yet, it's better to use "det." It can refer to any singular object when used on its own as the subject.
So you cannot say: Er den de siste gruppen?
"de" definitely does not work there, it's for plurals and this sentence is about a singular group. You also wouldn't say "Er den den siste gruppen" because that would be weirdly asking if the last group is itself.
Oh yes ofcourse, "de" can never be right. Thank you!