How to solve it when the iPhone is going to be locked for 48 years? A mom gave her iPhone to her kid to play with (or possibly watch cartoons on YouTube), and the phone was auto-locked probably due to some time of inactivity.

Then the kid just randomly entered some passwords and then when the mom saw the phone again, the phone showed it would be locked for 25,114,984 minutes, before the user can try to enter the password again.

That's 48 years. How can it be solved, if the mom doesn't want to wait for 48 years?
This is very unlikely a security issue. This insane amount of minutes message is usually due to the iPhone clock being reset. You should be able to solve it by rebooting the phone (might need to do it a couple of times) with a working SIM card in that has data. When the phone boots it should sync the time and unlock everything.