In NumPy 1.x, np.array(x, copy=False) meant avoid a copy if possible and copy otherwise. NumPy 2.0 changed the meaning to never copy, and raises ValueError: Unable to avoid copy while creating an array as requested when the input cannot be viewed directly, for example a Python list or an array needing a dtype change.
The old semantics now live in copy=None, which is the default, so np.asarray(x) and np.array(x, copy=None) both mean copy only if needed. This is a silent-to-loud change: code that used the flag as an optimisation hint starts failing on inputs it previously handled.
Replace np.array(x, copy=False) with np.asarray(x), which reads better and behaves identically across both versions. Where you genuinely require no copy, keep copy=False and let the ValueError enforce it, which is the point of the new behaviour. The same copy keyword semantics apply to ndarray.astype and to the array API's asarray, so the rule generalises.