Take a closer look at the output from apt-get when you attempt to install python3.10:
root@3d5f9653d655:/# apt-get -y install python3.10
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libqgispython3.10.4' for regex 'python3.10'
Note, selecting 'libpython3.10-stdlib' for regex 'python3.10'
libqgispython3.10.4 is already the newest version (3.10.4+dfsg-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
It treats python3.10 like a regular expression, and matches it against libqgispython3.10.4. There is no python3.10 package available, and if you were to use the apt command instead of apt-get you would get a better error message:
root@3d5f9653d655:/# apt install python3.10
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.10
E: Couldn't find any package by glob 'python3.10'
This behavior is documented in the apt-get man page:
If no package matches the given expression and the expression contains one of
.,?or*then it is assumed to be a POSIX regular expression, and it is applied to all package names in the database. Any matches are then installed (or removed). Note that matching is done by substring solo.*matcheshow-loandlowest. If this is undesired, anchor the regular expression with a^or$character, or create a more specific regular expression.
It's a dumb behavior, particularly because packages name legitimately contain . characters, but we're apparently stuck with it.