Zend certified PHP/Magento developer

Change Bundled/Grouped Product Stock Status Depending on Child Stock

When I create a bundled or grouped product in Magento 2.4, the product stock status stays In Stock even if one of child items are Out of Stock.
A grouped/bundled product only marks out of stock is all of the child items are out of stock. If any of the child products are Out of Stock I would like the Grouped/Bundled product to change to Out of Stock too as we do not want to sell incomplete bundles.
Is this the default Magento behaviour and is there any way to change it?