Try using the PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW
environment variable.
First you'll need to regenerate your screenshots with the PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW
turned on. E.g.:
PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW=1 playwright test --update-snapshots
After that, set this variable every time you run the Playwright in the headless
mode:
PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW=1 playwright test
This helped me with the exact same issue.
References: