You are not logged in

So I posted why we end up with "screen.xterm" or alike in previous comment.

I think it's more of discussion if we want screen to behave the way it is or force user input.
I would also assume that user input as long as it's correct takes precedence over how it behaves currently, so it should probably first check user passed value and if there is not corresponding termcap proceed with other checks.

I have compared termcap.c file from git and from Fedora package and they are identical. I have tried even copy termfiles to ~/.terminfo folder (as you wrote in previous comment) but even now I am not able to set 'screen' string as term variable (so in screen will have TERM variable value 'screen').

I am really confused. Is there some way how to get some debug information?

I have found something interesting,
in Fedora (but I don't know, if only there or if is this presented even on other OS) we are not able to set terminal type to 'screen' only using -T parameter. Any other terminal value can be set without any problems.

Unfortunately, there is probably presented some heuristic (that is used for setting vt100 terminal type in case of nonsense terminal type is setted as -T parameter), which caused this issue. I am just don't know, if this heuristic is done by screen package or any other system service.

screen ignores the terminal type setting, either via the command line option -T or via the .screenrc setting "term". It always sets TERM=screen.xterm-256color, but this is incompatible when SSH-ing into older systems that don't have that terminal type defined.