The website says that these sentences are correct:
Ref. britishcouncil.org
We can also use before + past perfect to show that an action was not done or was incomplete when the past simple action happened.
1.They left before I'd spoken to them.
2.Sadly, the author died before he'd finished the series..
https://learnenglish.britishcouncil.org/grammar/b1-b2-grammar/past-perfect#:~:text=We%20can%20also%20use%20before,he%27d%20finished%20the%20series.
Ref. Cambridge dictionary
We commonly use before with the past simple tense. It suggests that the second event happened soon after the first one.
3.Before she left, she gave everyone a present.
Why is "before + past perfect" used in first 2 sentences and "before + simple past" in Sentence 3?
Edit 1.
I understand that we can use the past perfect to show the order of two past events. But if we use "before" or "after" (instead of when), we can use Simple Past tense.
I would appreciate if "before + past perfect" for incomplete action mentioned in britishcouncil.org website is explained. I found the same information elsewhere.