Sorry Sasha Shpota, I don't have a definitive answer. But I've been digging around on forums to find an answer to an audio problem that I have and this problem does seem related to PulseAudio and how it recognises devices. There's lots of commentary on how capricious PulseAudio can be, especially when there are multiple audio devices.
What I can recommend is that you install and take a look at the app pavucontrol. Whilst using this audio configuration app didn't help me, it did list all of the audio input and output apps and allowed me to switch things on and off. It might be that you find that the builtin speaker is switched off at the software level and that you can switch it back on using pavucontrol.
To find out if you have pavucontrol:
dpkg -l pavucontrol
If it's not installed:
sudo apt install pavucontrol
Hope this helps. :)