Not perfect but in the meantime this small script can be used to wrap Jest and Playwright scripts and capture these errors to later remove the package + task prefix.
#!/bin/bash
$@ |& tee output.txt
cat output.txt | grep " ::error " | sed -e "s/^.*:.*:\s::error/::error/"
failed=$(cat output.txt | grep " ::error " | wc -l)