It is not sufficient to just capture stones using connect-and-die. It is important to ensure that the captured stones allow White can make two eyes. In other words, beware of the captured stones becoming a killable eye shape. However in this problem, making 2 eyes is not possible.
The solution to this problem is ko.