That wasn’t the reason I pointed it out. There were some changes between the 24.04 and 26.04 version of the apache2.service, so assumptions made about how it worked in 24.04 may no longer hold.
ProtectHome=read-only
sticks out in the 26.04 version of apache2.service.
As for the permissions script, maybe it silently fails at some point, or the prior rsync does in subtle ways. You should check the actual permissions of the files in question. You may also need to check the whole path, because $HOME can be set drwxr-x---, so the www-data user can’t even access it.