Normally the target is the last thing chosen - but the apparatus adds a subsequent step
I largely agree with NautArch's answer that the caster does not get to select a new target and that they are unaware of the the nature of the spell until it has been cast, both for the analysis of text and the lore cited. I do have an opposing view about the nature of selecting a target, however.
What NautArch characterizes as "There are some Sage Advice Compendium directions given, but they aren't necessarily clear or helpful in this case", are explicitly as follows:
From Sage Advice Compendium:
You choose the targets of a spell when you complete casting a spell, not when
This arose from a question about slow, asking what happens when caster takes two turns to complete a spell and the intended target at the start of the spell is no longer eligible when the spell is completed; by saying that selecting the target is last thing that happens, such a caster would chose between legitimate targets at the time of spell completion on the second turn, not when the spell was begun and after everyone in the Initiative order had had a chance to move into or out of spell range, cover, and visibility.
From the Sage Advice Compendium:
Your target must be within range when you take a readied action, not when you first ready it.
While not immediately obvious from the text that this applies to casting, consider the case of a caster who has readied a magic missile spell (which is an example given in the Player's Handbook). The spell is begun before the target is visible, the spell is maintained (using Concentration) even after the caster's turn has ended, and when the desired target finally appears, the caster's Reaction is used to select the target and complete the spell.
Thus while the PHB does not make it obvious, multiple rulings in the SAC confirm that selecting a target is the last part of casting a spell. If you like, you could use an analogy of summoning a magical effect from elsewhere, building up its arcane power, and finally 'grounding' it by selecting a target to act as its bridge to enter this world.
To the specific point of the Mizzium Apparatus, however,
You expend a spell slot to cast the spell as normal, but before resolving it you must make an Intelligence (Arcana) check. The DC is 10 + twice the level of the spell slot you expend to cast the spell.
On a successful check, you cast the spell as normal, using your spell save DC and spellcasting ability modifier. On a failed check, you cast a different spell from the one you intended.
Notice that after you spend your spell slot, you cast the spell "as normal." As normal implies that the last thing you do is select the target for your intended spell.
"[B]efore resolving it" means that the apparatus then introduces an additional step (specific over general), placed between target selection and spell resolution; the Arcana check. A failed Arcana check changes the identity of the spell, but it is in no sense letting you re-cast the spell or choose a different target. Because you have already chosen the target, it is too late to do anything about it when the new spell comes into being.
"[A] different spell from the one you intended" implies that you are not aware of the actual spell you are casting until it is too late. You have already chosen the range, target, etc. when you suddenly learn that you did not actually cast the spell you had meant to.
Note that given the variety of different spells on the list for the Mizzium Apparatus, there is a reasonable chance that the caster did not select a valid target for the replacement spell - they selected a point in space when the spell requires an object, they selected an object when the spell requires a creature, they selected a hostile creature when the spell requires a willing creature, etc. In this case the DM would then also need to rule on casting a spell with an invalid target, but with the caveat that the Mizzium Apparatus itself specifies that the spell slot has already been used regardless.