Consider a scenario where a party of adventurers encounter a lich. The party is armed with mundane weapons which can't hurt the lich so the spellcasters begin casting magic weapon. The lich casts globe of invulnerability in response to this and stays inside of it. So what happens when the party starts attacking the lich? According to the globe of invulnerability spell description:
Any spell of 5th level or lower cast from outside the barrier can't affect creatures or objects within it, even if the spell is cast using a higher level spell slot. Such a spell can target creatures and objects within the barrier, but the spell has no effect on them. Similarly, the area within the barrier is excluded from the areas affected by such spells.
Is magic weapon excluded from working inside the globe because of the last sentence?