Update from 4.4.11 to 5.0.2 failed with some Errors

Your software
My Mautic version is: 4.4.11 → 5.0.2
My PHP version is: 8.1.27
My Database type and version is: 10.3.39-MariaDB
My operating system: Rocky Linux 9

Your problem
My problem is:
At the beginning I have version 4.4.9 (Mautic 4.4.9 - app/prod) and the PHP version 7.4.33.
The command to find the next possible version shows the Version 4.4.11.

> php bin/console mautic:update:find
Version 4.4.11 of Mautic is available for download. Please visit https://github.com/mautic/mautic/releases/tag/4.4.11 for more information.
To update, you can run 'php bin/console mautic:update:apply' from the command line.

So I installed this version in the common way:

> php bin/console cache:clear

> php bin/console mautic:update:apply
Are you sure you wish to update Mautic to the latest version? y
Step    6 [----->----------------------] Removing deleted files
<warning>IMPORTANT: Run the same command again with --finish. For example 'php bin/console mautic:update:apply --finish'</warning>

> php bin/console mautic:update:apply --finish
Step    3 [==========================] Success! You are now running version 4.4.11 of Mautic.

So far there have been no errors.

Now I would like to take the next step and install Mautic version 5.0.2.
I know I need a newer version of PHP, so I installed it to PHP version 8.1.27.

> php -v
PHP 8.1.27 (cli) (built: Dec 19 2023 20:35:55) (NTS gcc x86_64)

I have also installed this version in the usual way:

> php bin/console mautic:update:find
Version 5.0.2 of Mautic is available for download. Please visit https://github.com/mautic/mautic/releases/tag/5.0.2 for more information.
To update, you can run 'php bin/console mautic:update:apply' from the command line.

> php bin/console cache:clear

> php bin/console mautic:update:apply
Are you sure you wish to update Mautic to the latest version? y
Step    6 [----->----------------------] Removing deleted files

<warning>IMPORTANT: Run the same command again with --finish. For example 'php bin/console mautic:update:apply --finish'</warning>

> php bin/console mautic:update:apply --finish
 [WARNING] Some commands could not be registered:                                            
In UpdateIpDataStoreCommand.php line 17:
  Mautic\CoreBundle\Command\UpdateIpDataStoreCommand::__construct(): Argument #2 ($ipService) must be of type Mautic\CoreBundle\IpLookup\AbstractLookup, null given, called in /var/www/html/var/cache/prod/ContainerNCiM8yF/getUpdateIpDataStoreCommandService.php on line 20 

As you can see there are one error which fired two times.

Now I have tried to open Mautic with the browser, but I get a different error in the browser:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". 

These errors are showing in the log:
unfortunately no

Steps I have tried to fix the problem:
I have checked the PHP version again, but it is still the version 8.1.27.

I have also checked the file “vendor/composer/platform_check.php”.
The presumed condition of the platform test is as follows:

if (!(PHP_VERSION_ID >= 80002)) {
    $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.';
}

I have checked the content of the mentioned variables in the console.

> php -r 'echo PHP_VERSION_ID."\n"; echo PHP_VERSION."\n";'
80127
8.1.27

I have no idea what I can do. I have the one error with the file “UpdateIpDataStoreCommand” and the error with the probably incorrectly recognised PHP version.

What else can I try?