If Cypress crashes, times out, or the machine is slow, the screenshot or video file might be written incompletely.
Fix:
Delete old screenshots and videos before running tests:
rm -rf cypress/screenshots/*
rm -rf cypress/videos/*
If this does not works, go with the test by commenting the lines of codes you're using for screensots capturing. *WORKS FOR ME*