What is this comparison?
A version-string check compares one PHP version number to the advisory, the way banner-based scans and quick php -v checks do. The package-aware check is our own code-only version of what package scanners do: each installed dpkg version against the distribution's fix record. It is not the output of any of those tools.
php8.4-fpm is at 8.4.16-1~deb13u1; Debian fixed both CVEs in 8.4.27-1~deb13u1.
sudo apt-mark unhold php8.4-fpm && sudo apt-get update && sudo apt-get install --only-upgrade php8.4-fpm php8.4-common
php8.4-fpm is on hold, which is why upgrades skipped it. Unhold, upgrade, then restart PHP-FPM.
Debian ships this fix in trixie-security. If apt finds nothing newer, add deb http://security.debian.org/debian-security trixie-security main to your apt sources, then run it again.