MySQL error 1525: Incorrect DATETIME value: ''

The error belongs to version/config of mysql for sure. However, downgrading is not an option as this is production system and 8.0.31 is most stable security update.

Here release notes of introduced change in 8.0.16:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-16.html

BTW. there are similar issues reported by others: