What does big O mean in KNN optimal weights?
From Optimal weighted nearest neighbor classifiers Richard J. Samworth
derived an asymptotic expansion for the excess risk (regret) of a weighted nearest-neighbor classifier. This allows us to find the asymptotically optimal vector of nonnegative weights, which has a rather simple form. He showed that the ratio of the regret of this classifier to that of an unweighted k-nearest neighbor classifier depends asymptotically only on the dimension d of the feature vectors, and not on the underlying populations.
From the paper in (Page 11-12)

In a complementary approach to that taken in most of this paper, Audibert and Tsybakov (2007) study the minimax properties of plug-in classifiers.
They show in particular that a certain classifier obtained by modifying a
the local polynomial estimator of the regression function $η$ attains the minimax
rate over a set of distributions $P$ of random vectors $(X, Y )$ on $\mathbb{R}^d * \{ 1,2 \}$ for which the regression function belongs to a H¨older class, $P$ satisfies a margin condition and the marginal distribution of $X$ satisfies a so-called strong density assumption. This rate is $O(n^{−4/(d+4)})$ when the H¨older smoothness parameter is 2, and the margin power parameter is 1.

From the properties of Hölder condition

Any α–Hölder continuous function f on a metric space $X$ admits a Lipschitz approximation by means of a sequence of functions $(f_k)$ such that $f_k$ is k-Lipschitz and
$ {\displaystyle \|f-f_{k}\|_{\infty ,X}=O\left(k^{-{\frac {\alpha }{1-\alpha }}}\right)}$.

Here we can state that the Big $"O"$ is just an $"O"$ in Holder condition with Lipschitz approximation and not a Big-O-notation