VBoxContainer and HBoxContainer by design both try and reduce the size taken up by children Control nodes as much as possible. Because of this, to ensure that a child Control node doesn't collapse itself you need to set the rect_min_size
property instead of the rect_size
property.
One caveat is that the width of a control in a VBoxContainer will always be fixed to the width of the VBoxContainer, and the same with height and HBoxContainers. There are ways around this though, such as having a Control node as the direct child of the WhateverBoxContainer, and then a Button as a child of the Control with a smaller width or height.