Multiply time windows problem

Hello everyone!
If there are two pickups time windows how is costPerWaitingTime taken into account when optimizing? So far, according to observations, the wrong window is selected and because of this, there is an increase in the downtime of transport on the way. At the same time, loading is available in both windows