I don’t have much experience with high end or electronic groupsets but I have never been shifting on my bike (R7020 groupset) and thought that it was a limiter to my performance. I think anything beyond R7000 or R8000 mechanical is marginal improvements. I am pretty interested in Di2 but if I were to buy a new bike I think I would rather save money on the bike and get mechanical shifting and put that money into new wheels.
Yeah most bikes will upgrade groupsets before upgrading the wheelsets (as you move up a manufacturer’s line-up). I think this has a started to change though as more companies move to create their own wheels (e.g. Specialized and Roval).
Most bikes these days are so close in terms of performance that I think you should prioritize whatever will excite you the most. So if that is electronic shifting then find a Di2 bike. If that is a sweet looking celeste Bianchi then go that direction. Also, it is almost always cheaper to upgrade a groupset or wheels than it is to upgrade a frame.