Are you using X11 or Wayland ?
If you are using Wayland it is a known issue that Wayland does not use a login shell
Traditional session setup
Under X11, starting a graphical session typically involves running a tower of shell scripts starting with /etc/X11/xinit/xinitrc or similar. Another noteworthy point is that the shell running these scripts is a login shell, which means that is sources /etc/profile, ~/.profile, and so on.
I don't know specifically what is happening but there are references to /usr/bin/id in /etc/profile which isn't sourced when Wayland starts.