It seems you have learned to use 「[次第]{しだい}」 incorrectly somewhere.
In saying "upon doing A", 「次第」 cannot follow directly the dictionary form or the past tense form of a verb like [食]{た}べる and 食べた in your sentences. The only verb form that can precede 「次第」 is the [連用形]{れんようけい}. For the verb 「食べる」, the 連用形 is 「食べ」.
The tense of the sentence is NOT expressed with the verb preceding 「次第」. It is expressed with the verb that follows 「次第」, which is the main verb of the sentence. It is, of course, 「[帰]{かえ}った」 in your sentences.
The correct sentences are:
「ランチを食べ次第帰った。」 or
「ランチを食べ終わり次第帰った。」 (終わり is the 連用形 of 終わる)
Both mean "I went home as soon as I finished lunch."
IMPORTANT: You do not add 「に」 to 「次第」 in these sentences. The only time you need to is when you want to say "gradually".
「[日本語]{にほんご}が次第にわかってきた!」 = "I am beginning to understand Japanese!"