This approach is good enough for detecting automation and block most of the script kiddies trying to get an easy web scraper. Although, the better alternative can be done with fingerprintjs and botd, both tools can detect Playwright and Selenium, even with stealth plugins, notably Cloudflare implements something similar.
How hard would it be for an attacker to spoof all of the data fields that the Javascript client sniffs?
Using selenium or playwright stealth plugins, even replacing the prototypes and properties to spoof a legit browser would be useless, because fingerprintjs and botd use some prototype magic to detect tampered properties. However, using DrissionPage would be enough to bypass this detection, as it doesn't use the webdriver API. So it would be very hard to spoof everything correctly, requiring a custom browser built for this purpose, this would stop automated pre made tools like Scrapy, but not custom built code.
Still this is all dependent on your threat model, if you are working with more advanced developers that are good with scraping, they will probably use DrissionPage or some other webdriver-less framework in order to emulate a real browser, and fingerprintjs or botd won't be able to catch them because they are designed to not expose any API different than a regular browser.
http://drissionpage.cn/
https://github.com/g1879/DrissionPage
An alternative solution is using a captcha, but it can also be bypassed by services like 2captcha and AI easily, so it still doesn't fit the advanced developer threat model.
The preferable approach would be to use some challenge that would put the browser to mine some kind of hash and waste a few CPU cycles, this could be implemented with webassembly (and JS as fallback), which would make scraping considerably harder, as it doesn't "cache" the results in cookie, unlike captchas (solving one captcha might give you multiple requests). Also, CPU-bound anti bot doesn't annoy users as much as captcha, specially for VPNs and Tor, while still granting somewhat of a bot prevention system. It should also be noted that a lot of developers forget to "consume" the captcha in the Google's API, making one resolved captcha valid for billions of requests.
Even though it is possible to hinder scrapers, both captcha and CPU bound challenges are only a measure to delay or annoy scraping, and they are as good as their implementations, the CPU challenge needs to be dynamically generated by a backend and correctly verified, also should be reliant on a good enough RNG (not pseudo random predictable one), the same thing is true about captchas, they need to be implemented correctly, with the correct sitekey and sent to Google servers for consumption (so it invalidates the captcha after use).
It's also possible to block any IP coming from a datacenter, VPN and/ or Tor, however I don't see this as an ideal solution, many people use VPNs and corporate networks might pass through a datacenter or proxy of sorts, also an actor could use a residential proxy with IP rotation to scrape. The better way would be to implement rate limit by IP, making an IP not able to flood requests. This could also be set up by endpoint basis, but it is dependent on the threat model, as implementing the solution this way opens up for an endpoint DDoS attack.
So, in short, there is no bullet proof solution to block all scrapers, but there are methods to hinder it enough that less skilled scrapers will give up early.