I would allow some variation of this to each full-spellcasting class, but it would have to vary based on the nature of spellcasting for that class.
Clerics and Druids (Perhaps Paladins and Artificers): They are essentially just getting to have all the class spells prepared at the tax of a higher spell slot. Not a problem with me. I might require it be two levels higher, but honestly this does more to just streamline play by eliminating "we all have to take a long rest because we need x spell I don't have prepared to solve x problem. On that front I think I would prefer the version of this that has a 10 minute casting time, because really I think it is more reasonable with utility spells than combat, and likely to speed up exploration and problem solving rather than slow down combat by suddenly having people look up all sorts of unfamiliar spells on their turn.
Wizards: It should work for any spell they know. They know the damned spell. It is just a gamey holdover that they somehow can only recall a spell they didn't practice that morning after a good nights sleep. If they've never learned the spell though it makes no lore sense for them to be able to use it. Players are likely to understand the spells they have taken so practical concerns of use in combat are lessened.
Warlocks: If your patron wants to help you out, I don't mind it. Once a day they should get to call on their patron to let them cast a Warlock spell for which they have a spell slot 2 levels higher. Thus they eventually get a big list of third level and below magic for which they have a limited access. I really think it just streamlines situations where they need X spell for utility. It is rarely going to be the best use of their spell slots in combat, but it saves the higher level Warlock from having to have dispel magic or whatever clogging up their spells known, and makes them more viable as the general caster in smaller parties.
Bards: Lorewise I go back and forth. I both like to think of them as the ones who know spells because they really practiced that spell but also as a class where it feels like, just as a skilled musician can muddle through a variety of easy songs they have never really practiced, they should be able to take a shot at low level magic they don't know. Also they have a fairly thematically circumscribed spell list in terms of what they can do, focused mostly on buffs, debuffs, social/shenanigans magic. Please don't lecture me on the numerous exceptions, I know about the numerous exceptions, the point is simply that they are a class where generalized spell list access is a less versatile gift than with others. Finally they are a class that gets new abilities or ability boosts at every level except 7 and 11. I would therefore, as a class ability, say that at level 7 I would give them all 1st level Bard spells as 2nd level spells known, and at level 11 all 2nd level Bard spells as 3rd level spells known.
Sorcerers: I believe Sorcerers are the worst designed class for low levels in 5e, and even if you can't agree with that you should at least agree that they get the least love at second level. They Sorcery points which they can only use to generate one level 1 spell slot, something wizards can already match with Arcane recovery, albeit not on a bonus action. So there they are at level 2 and they really don't measure up to their rival the wizard at all. They then proceed to spend a couple more levels as a crappy wizard who can unleash amazing metamagic a few times a day before eventually, in tier 2, having the resources to be worthwhile in a campaign with more than one or two combats a day. Basically a really cool class that I never play unless we are rolling characters at level 5 or up.
Which is all to say that, rather than this spell, they should get the level 2 ability to pay the spell slot cost in sorcery points on top of a spell slot in order to cast any spell on the Sorcerer list. This should trigger a wild magic surge. It fits my perspective of the lore of them being people just bristling with intrinsic magic potential that they have limited power to control, and gives them the flexibility to cover a bit more utility. It also makes them stop being about the most stressful class to make spell choices for. If you view sorcerers more as people who have innate magic but only for the several spells they know, perhaps this doesn't jive with you. To each their own. I would limit it to spell levels 1-3 or 1-5 or some such, much like the spell slot purchasing ability.
A more limited option would be to give them access like this to a limited list of additional spells which almost no Sorcerer would otherwise take. A sorcerer shouldn't have to waste a known spell on featherfall just because they know that there might be that one time on the airship with the dragon when they will absolutely need it.