google sheets – Why my Arrayformula doesn’t work

I have this google sheet :

enter image description here

link is here :

On the top is my matrix table. It has key on the left and data on the right. I want to pull the key based on the data if the data is not null.

On the 2nd table i used manual copy/paste and it works perfectly. The formula in B10 :

=ifna( vlookup(B2,{B$2:B$6,$A$2:$A$6},2,0) ,)

But on the 3rd table i tried arrayformula , and the output is wrong. Can someone spot what is the problem with the formula in B17 :

=ARRAYFORMULA(ifna( vlookup(B2:M6,{B$2:B$6,$A$2:$A$6},2,0) ,) )