The variations “threshold” is usually 30, though that can vary by theme. This is the maximum number of variations data that is loaded with the page. If you have more variations than the threshold, the data is not available to any Javascript working in the page, so there is no way of greying out or removing unavailable variations depending on other selections.
If you have less variations than the threshold, all the variations data are loaded with the page, and unavailable variations cannot be selected. WooCommerce does this already. To confirm, setup a test product with less than 30 variations where some combinations are not avaiable, and observe the behaviour on page.
You can increase the variations threshold using this snippet in functions.php for your child theme:
https://gist.github.com/mohsinoffline/f06c66259e667d6b16bb
As you make the threshold bigger, the page size gets bigger so page load time will increase. You’ll need to make a judgement.
Someone said this doesn’t work if the WooCommerce Stripe plugin is active but I don’t know if that’s still the case.