DMs can also allow respecs at their discression, there are really no hard set rules in a tabletop where the DM's word is law. A DM can be as flexible or as rigid as they please.
When I was kind of not satisfied with my Mastermind Rogue for example my DM let me switch to Arcane Trickster and worked out a story reason to explain it. Same thing when the wizard, a relatively new player, wanted to swap subclasses.