A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
It seems you may have been misinformed about how XLOOKUP works.
In your first example the 2nd argument refers to an array which isn't shown [D5:E6]
In the 2nd example your first argument is a cell [G5] which is contained in the array referred to in the 2nd argument [G5:H6]
In the 3rd example you've specified the entire data range rather than just the column to be searched
Have a look at the information provided in the Microsoft Support article XLOOKUP function