You don't come to the kitchen sink and press the button or you'll just open the cooking menu as you said.
Instead, you keep the window on your inventory, select it and once it's selected, you can place it on the wall.
It's a little fiddly on Switch (the platform I play on too), because if you just walk up to the wall, you'll open the Cooking GUI, as you mentioned. However! – there is a workaround.
You're going to have to use your right joystick, which I'm guessing that you've never done before because it's extremely impractical. This will bring up a cursor that is incredibly finicky, but if you select your Window and finagle the cursor onto the wall above the kitchen, it should go in with a simple press of either A or Y. You can do this from any distance, and you'll need to make sure you're not going to interact with any other furniture from the place you're standing.
The physics of the cursor leaves something to be desired, but hopefully you can get it to work for you!