What does the error Error in `stop_subscript()`mean when applying knn function from the neighbr package?

See the FAQ: How to do a minimal reproducible example reprex for beginners for how to attract more targeted answers.

If ID is character, try with a copy of the data.frame that omits it.