While on the Variant Dependent Method of Custom Pricing, if a customer is able to purchase a Custom Pricing variant when it’s out of stock, this is usually because the variant is still marked as in stock.
To fix this, you should manually sync your inventory within Custom Pricing. We generally suggest syncing the inventory when you create or edit a Product Pricing Group.
Visit How does Custom Pricing handle inventory? for more information on how Custom Pricing works with your store's inventory while on the Variant Dependent Method of Custom Pricing.
Note: The Draft Orders (Standard) and Accelerated Methods of Custom Pricing do not create variants. Visit Discount Methods and How to Switch for more information on the benefits and limitations of each version and how to switch.