I went to the Pokémon league but healed my Pokémon at Littleroot. Then I challenged Steven after beating the elite4. I lost but then it brought me to Sootopolis because I healed my self there before. Shouldn't it bring me to Littleroot.
I don't think this is a glitch, you can't spawn in littleroot town after you lose a battle so you respawn at the last Pokemon center you healed at before you healed in littleroot.