I'd propose an alternative solution that I've used when calculating rising block tariffs that avoids the complication of array formula. This allows you to drag across all cells on the block for a prorata calculation.
=IF(MIN(C11-($B5:B5),B5)>0,MIN(C11-($B5:B5),B5),0)
This might be slightly less elegant but easier to understand and troubleshoot. I used this logic when create a business electricity rates calculator for my website.