I didn't do any math, just going off of experience building quite a lot of encounters here. If an exact calculation is what you want, leave a comment and I'll delete this answer.
Coinflip encounter
This encounter will come down to the initiatives rolled. With 13 AC and 28 hit points, neither of the swarms should live more than one attacking round from the party at level 6, even taking into account resistances. They should however take up approximately that round of attack by the players.
Which leaves the Living Spellbook, which gets a practical one round of free attacks because the players will be dealing with the swarms. If they're careless or unlucky (aka, you felt like giving them a hard time), the book will use two multiattacks on the sourcerer or artificer, who should go down fast. At that point the combat depends on whether they were able to dispel the mage armor. If the swarms got off an attack before dying, I'd say those chances are low. Otherwise they are high and the fight should be a breeze for the barbarian and fighter (the arcane explosion should do approximately zero agains them with a Strength saving throw).
So the 2 scenarios I see happening are:
Swarms have relative high initiative
- The swarms attack the artificer and sourcerer for about 50% of their HP
- The swarms die
- The Living Spellbook effectively takes out the artificer and sourcerer out of the fight
- Mage armor isn't dispelled, your barbarian and fighter have a hard time, but should barely win out before any deadly casualties. Bad dice rolls for the player result in a loss
Swarms have relative low initiative
- Swarms die immediately
- Sourcerer dispels mage armor on the Living Spellbook
- Living spellbook becomes a glass cannon with 14 AC, which both the barbarian and fighter easily break
- Fight is a breeze, biggest risk is a small paper cut by one of the twirling paper sheets
Frozen
This is a great combination! The rules for casting two spells with a bonus action and action simply state (PHB, 202):
A spell cast with a bonus action is especially swift. You must use a bonus action on your turn to cast the spell, provided that you haven’t already taken a bonus action this turn. You can’t cast another spell during the same turn, except for a cantrip with a casting time of 1 action.
In your example, you have used your Bonus Action via Metamagic to cast Wall of Water. There is no save for wall of water; it only creates battlefield control aspects within its area.
Should you cast it on a space containing a creature, that creature would be within the Wall (although do note the Wall is only 1' thick.) Also note that only the 5' section of the wall they are in (see below) is turned to ice (and if destroyed, does not refill with water.)
The creature is now in 1' of water and the follow-up Action Cantrip of Ray of Frost interacts beautifully with Wall of Water's cold damage response:
Spells that deal cold damage that pass through the wall cause the area of the wall they pass through to freeze solid (at least a 5-foot-square section is frozen). Each 5-foot-square frozen section has AC 5 and 15 hit points.
You'd now have a Wall of Water with a frozen section containing a creature in their 5' space (but only 1' thick of ice.)
But what can a frozen creature do?
This is going to likely get table-dependent. There are no rules with regard to being 'in ice' and what conditions that imposes (like Restrained or Grappled.)
How I'd rule
I'd likely give a Dexterity save to avoid the ice (DC set by the caster, much like with Wall of Stone trying to entrap someone) and then upon failure give them the Restrained condition.
Best Answer
There is currently1 no way to do this in the rules.
If you're trying to avoid damage resistance, there is a feat that can help you: Elemental Adept. It lets you choose an elemental damage type, and spells that deal damage of that type ignore resistance. So, for example, you could take Elemental Adept (Fire), and your Scorching Rays would ignore fire resistance.
If you're trying to get around damage immunity, or exploit damage vulnerability, then you're out of luck. The only solution that currently exists is to pick spells with different damage types so that you always have the one you need.
Of course, this is D&D, so you could always ask your DM if they're willing to houserule something that would let you swap elements the way you want to. A metamagic option for the Sorcerer makes the most sense, but balancing it could be tricky. A Warlock invocation might also work here, but balancing it would be even harder.
1 Current published materials: DMG, PHB, MM, Elemental Evil Player's Companion.