Say you have a Wizard 7/Bard 9. You gain your 17th level and choose to gain the level in Bard (which grants you Magical Secrets). According to the Multiclass Spellcaster: Spell Slots per Spell Level table, you now have a single 9th level spell slot. Can the spells you choose from Magical Secrets be 9th level spells even though you can only cast up to 5th level Bard spells?
No. Magical Secrets specifies that the spells you learn from it must be
of a level you can cast, as shown on the Bard table, or a cantrip.
As a 10th-level Bard, you can only learn spells up to 5th level using Magical Secrets, even if you also have other levels in another spellcasting class.
To quote the Player's Handbook page 54 under the Bard Features:
By 10th level, you have plundered magical knowledge from a wide spectrum of disciplines. Choose two spells from any class, including this one. A spell you choose must be of a level you can cast, as shown on the Bard table, or a cantrip.
So that is the relevant portion. You can choose spells for which you have spell slots from your Bard levels alone.