When going through a newly built nether portal to the overworld the exit portal will almost always generate in a cave if there is a snowy biome at that location.
This is because nether portals require 4 blocks of solid material and air blocks above.
Snow layers are not considered solid and are also not air blocks.
I believe the original intention was to spawn a portal on the surface if possible.
Reproduction steps:
Generate a world with seed
4979821127687821401
Run
/execute in minecraft:the_nether run tp @s -295 76 309
Build a nether portal
Go through
Notice you end up in a cave instead of on the surface
I can confirm. For the test, I used a completely snowy world.
[media]