I forgot to tell one thing. When I plug an externel speaker and then unplug it the sound starts working for some time and then again it turns into headphone mode.
Weird. May be you want to move all files inside
~/.local/state/wireplumber/
to other folder (as backup) and leave it empty. Then logout and login again. It will reset the wireplumber routing nodes.