Almo's advise to allow the player to assign spells to hotkeys according to their own preference is good. You can increase the number of spell slots if you allow modifier keys like Ctrl and Shift to access additional hotkey bars (but keep in mind that when the player has one hand on the keyboard in the typical WASD position and the other hand on the mouse, any numbers beyond 5 become awkward and beyond 7 become impossible to reach while also holding Ctrl or Shift).
Alternatively you can use a hotkey bar cycling system. Allow the player to set up multiple hotkey bars and have keys which cycle through the bars the player configured. That way the player can easily use different hotkey configurations for different situations.
But you might also want to think about less orthodox input methods.
Mouse gestures, for example. Represent each spell with a symbol. In order to cast the spell, the player draws that symbol with the mouse. You can reduce the complexity by combining it with hotkeys. For example, use a hotkey to select the element and then use a gesture to select how that element is used. However, recognizing mouse gestures reliably is not easy to program, and you have to implement it well to really judge if it is usable. I would only recommend you to try this when you are either 99% sure you want to go this way, when you have enough budget that burning a few hundred man-hours on this isn't an issue or if there is good 3rd party technology for this available for your technology stack.
Another option is to assign spells not just to single keys but to sequences of keys. Magicka is an interesting example. The game has over a thousand different spells, but they are cast with just 8 hotkeys. Simple spells are just one hotkey followed by a click, more complex ones have longer combinations. A frost ball is thrown with the sequence DQRClick and the mighty "Blazing Arcane Steamball" with DSQFQFFClick. No, this system does not have a very beginner-friendly learning curve (and making the entirety of it available to the player after just a brief tutorial makes it worse). But mastering this system by figuring out the best combinations for each situation feels very rewarding for most players. After a while players memorize the sequences for their favorite spells and can cast them from muscle memory.
But if all of this is still not adequate to cover the variety of spells in your game, look into ways to reduce the number of spells available to the player at any given time. When you have spells which are "not being used in the late game", then why does the player even have them in the late game? When a late-game spell is simply a better version of an early-game spell and makes it obsolete, then it could just replace it completely in the user-interface.
There might also be some spells which are so situational that they don't deserve a hotkey. Those might be used from a menu. Monitor your testplayers and see which spells get used very rarely and usually not in time-critical situations (long-lasting buffs, for example). Ban those to the menu. A spell which is just used as part of the story might not even be a spell in the game-mechanical sense. When you have a "lift frog-shape curse" spell and exactly one person in the game who got turned into a frog, just have the player-character cast it in a cutscene.