Error while using the stitching_detailed.py code on some images

Everything is according to this website:

https://docs.opencv.org/4.x/d8/d19/tutorial_stitcher.html

Here is the python code:
https://raw.githubusercontent.com/opencv/opencv/4.x/samples/python/stitching_detailed.py

I hope you can help me solving this knn error while doing feature matching.

It is important to mention that while using the Autostitch programm with the same images it works fine, meaning it should work as well with the Opencv code I think.

Wish you all Happy New Year.