Blender renders HDRI instead of background clip
Ok, turns out this automatically created node was responsible. It's not supposed to be here.

I guess I'm not gonna delete this post for now in case someone else needs it.