The only explanation I can think of is your PHP-FPM pool with the wrong user.
If you use PHP 7.3, try looking at:
/etc/php/7.3/fpm/pool.d/www.conf
Look at the user key, it should be set to www-data, as well the group key.
Perhaps the lines below help you with finding something suspicious:
cd /etc/php
grep -e '^user =' * -r