The magic keyboard works great. You can even get BT knock offs for 1/3 the price. Works fine on your lap.
I can't speak for Surface Laptop, which I think had a bulky keyboard, but the the normal ones (I think was called Pro), always felt weird. Obviously this all is personal choice.
I think the overall point is, iPad is nice replacement only if you are not going to be using keyboard much.
The cantilever design iPad keyboards are indeed very heavy to counter the tablet weight. Which brings the total weight of an iPad with the keyboard to almost MB Air weights.
The iPad is really crippled by software. Undoubtedly they cannibalise their own sales by allowing MacOS to run on iPads. But they have purposely killed off their own product categories before. Having that dual mode device is great.
That all aside, as an engineer it's too restrictive and less fun. I'm sure it can get a lot of other non-programming workflows done quite well though.