"My friend and I ate lamb for dinner yesterday."
Given that no other context was given, Duo should have accepted your answer. Merely the eating action happened in the past does not necessarily impose use of 了. There is nothing wrong if we say 昨天晚饭我吃魚，我的朋友吃羊肉, simply just to talk about the choice of food.
We use 了 when we want to indicate a change of state, which is "lamb eaten" in this sentence. In the following scenarios we would want to say it:
- Lamb being a specialty of the season or a dish that is not usually consumed. We want to highlight that "lamb eaten" appeared to you, as it is not normally expected;
- Your friend got poisoned and in search of the possible cause you explain to the doctor what you ate, so highlighting that "lamb eaten" appeared to you.
Words are omitted when they can be implied.
我和朋友 can already mean I and my friends, because the friends that I have dinner with would naturally be my friends. We would like to specify only those combinations that are less predictable, like I and his friends, he and my friends, etc.
This sentence has no problem grammatically. It is somehow less common to say 羊肉晚饭 which is equivalent to "lamb dinner". This make it a little not very natural. Some restaurants may offer set dinners and call them with their principle ingredient. In those cases the word 晚餐 is usually used (i.e. 羊肉晚餐).
It is not wrong... if you allow me to be nitpicking then 昨天晚饭 is not perfect as a time element (昨天晚饭时 at the time of dinner yesterday) or as a demonstrative element (昨天晚饭上 on the dinner yesterday). But that's the same little problem that Duo's sentence already has. Especially when it is conversational, such things are well acceptable.
我和朋友 is not unsplittable and it depends only if you want "I" to be the subject, or the block "My friend and I" to be the subject. In the former case 和朋友 becomes an adverbial phrase to 吃. Another concern is when it has gone too far away in the sentence then we need to consider not omitting 我 from 我朋友.
I went to drink beer with him first at the time of dinner, and then I ate lamb with my friends.
BTW where the "l" in your name has gone? Just curious.
Please explain to me when it's OK to put the time period (in this case yesterday dinner) after the subject of the sentence and when it has to come at that the beginning? It's always a guessing game for me.
Also, I agree with other comments--why is了necessary here when the context clearly indicates past tense?
Time put at the very beginning provides the setting for the whole sentence.
At this time, this happens.
Time put before the verb (we don't make reference to the position of the subject), it complements the verb.
This happens at this time.
(In the case without a verb, the main attribute)