Hello,
Sorry to say but it is the default functionality at the WooCommerce level that the Products of the Sub-Categories are also shown in the Parent Categories and it works globally for all sorts of Themes even with the default WordPress Themes too like Twenty Twenty Three & Storefront. So, this isn’t influenced by the Theme itself.
One thing you can do in this regard to avoid this, is to go to Dashboard > Appearance > Customize > WooCommerce > Product Catalog > there set the Category display as Show subcategories > then when you visit the parent category pages on your Site, you won’t see the same Products instead you will see the Subcategories: https://snipboard.io/daZYrx.jpg
This is the best way possible in this regard. Hope you can understand!
Best Regards