A「お昼休みなのに忙しそうだね」
B「午後から会議があるんだ」
A「ずいぶんゆっくりしてるけど、大丈夫?」
B「あっ、そうか!今日は午後から会議があったんだった」
A「今日一緒にご飯に行かない?」
B「ごめん、今日は彼女との予定があるんだ」
B「ごめん!さっき外食する約束をしたけど、今日は別の予定があったんだ」
Here are two dialogues. What would be the difference between あったんだった and あったんだ?
A「お昼休みなのに忙しそうだね」
B「午後から会議があるんだ」
A「ずいぶんゆっくりしてるけど、大丈夫?」
B「あっ、そうか!今日は午後から会議があったんだった」
A「今日一緒にご飯に行かない?」
B「ごめん、今日は彼女との予定があるんだ」
B「ごめん!さっき外食する約束をしたけど、今日は別の予定があったんだ」
Here are two dialogues. What would be the difference between あったんだった and あったんだ?
In such cases, there are two relevant differences to consider:
In the first scenario, in which two co-workers talk about a conference, B already knew that a conference was to take place on that particular day. They simply seem to have forgotten and are now re-establishing this knowledge. In that case, the original information about the conference came from A and is now re-stated by B.
In the second scenario, the information that B already has plans is new information to A. Therefore, it is in the present tense, as B is offering this new piece of information to A just now.
This use of た is called modal-ta or 発見のタ. There are a number of questions related to this on this site.
"fixing (or updating) one's previous knowledge/expectation" seems to be the key
It is used when one's expectation has just matched or failed to match reality.
In Dialog 1, B is updating his own knowledge, and that's why the sentence ends with the modal-ta. But 会議があったんだった sounds a little redundant to me. 会議があるんだった is equally correct and probably more common.
In Dialog 2, B is trying to update A's knowledge by telling what is already known to B, so the sentence must not end with the modal-ta. 別の予定があるんだ and 別の予定があったんだ are equally correct, but the latter contains a modal-ta before the end of the sentence to update A's knowledge; it implies "(I know) this is not what you've expected".