Update 2: Digging deeper provided the insight, that starting with Ensembl Release 104, gene records in the GTF files do not appear in ascending order any more (in Releases 103 and lower, they did). Here's what I found out: Ensembl Release 104 and newer GTF files no longer have genes sorted by position
Update: It simply seems like these files are not necessarily listing genes in the order of their chromosomal position and the order can change from release to release. So you cannot rely on them staying the same, but have to ensure a stable sort yourself.
Long story short:
The GTF files from Ensembl Releases 105 and 106 are not sorted properly, for some reason. If you need them sorted, just avoid those versions (getting them sorted does not seem to be possible in a sane and sound way, I tried). Namely, these files are broken:
Releases 104, 107 and 108 seem to be properly sorted.
I have found no indication of anything relating to this anywhere with a reasonable web search, and by manually looking through the Ensembl release notes and the Ensembl production code repository on GitHub (which I think contains the code that produces those files). As this latter repo does not allow for the creation of issues (at least not for me) and as I did not find any way to file a bug report on the Ensembl website, either, I am documenting this problem here, for others to find. This has cause me multiple days of hunting down weird behaviour in a tool, where it eventually turned out that it relies on the input GTFs being sorted.