To prevent background playback from stopping, go to Settings > Apps > YMusic > Battery and set it to "Unrestricted" .

Because YMusic relies on reverse-engineered YouTube APIs, things break often. Here are fixes from the 4PDA threads: