The problem of separating many items in the logistics system

I just want to know if there is a simpler way to achieve this, such as adding a setting that allows the logistics bus to not extract remaining items when the remaining quantity is less than the specified output quantity, so that stuck will never occur.