@apertur.co Could this be a solution?
arrayformula(vlookup(D3:D5,sort({B3:B,A3:A},2,false),2,false) )
vlookup looks up in the left column
{B3:B,A3:A} switches columns
vlookup looks up the first occurrence
sort({B3:B,A3:A},2,false) reverses the order