V + -(으)ㄴ 거예요 used for the action what the speaker has some information.
V + -었어요 used for the action what the speaker has no information.
뭐 한 거예요? : What is that you did? (The speaker saw some actions or heard some noises.)
뭐 했어요? : What did you do? (The speaker has no information)