Sort before you stop.
transcript
The loop stops at a large price. That is a good idea for sorted prices. With unsorted prices, it lost a box that fits.
The prices are six, two and three. The budget is five. The box two and three fits.
Unsorted, the first price is six. Six is above five, so the loop stops. The search returns nothing. Sorted, the box two and three is found. The only change is the sort.
Sorted prices never get smaller. A large price means the rest are large. So stopping loses nothing. That is why the bound needs the sort.
Try a list in a bad order. Compare with the plain version. Any difference is a wrong prune.
A prune must never cut an answer. There is no error message if it does. The answers go missing.
Sort before the bound. Then stop at the first large price. Check the answers against a plain search. Full breakdown in the lecture.