This has historic reasons, originally the cube only worked on yourself
The forcecage spell made its debut in the original Unearthed Arcana for first edition D&D. In its historic incarnation, the default mode of the spell was to create a cage made of force, with bars (UA, p. 61):
This powerful spell enables the caster to bring into being a cube of force, but it is unlike the magic item of that name in one important respect: The forcecage does not have solid walls of force; it has alternating bands of force with 1/2’ gaps between. Thus, it is truly a cage rather than an enclosed space with solid walls.
However, as stated in the spell description above, there also was a cube of force magic item in the game (DMG 1e, p. 142), and that item created a smaller cube with walls of solid force. The spell originally had an option to prepare it instead to mimic the form of that magic item:
By means of special preparation at the time of memorization, a forcecage spell can be altered to a forcecube spell. Forcecube has one eighth the area of effect (a cube 1 “ on a side), and the dweomer then resembles the magic of a cube of force in all respects [emphasis added]
The cube of force however only worked around your own person, as a protective device (DMG 1e, p. 142):
Cube of Force: A device of but about the size of a large die - perhaps 3/4 of an inch across- the cube of force enables its possessor to put up a wall of force 1" per side around his or her person [emphasis added]
So, in the original form of the spell, the larger cage version could be cast offensively around any target, but allowed the target to use breath weapons and ranged attacks through the cage, or escape if it could fit through or overcame it with magic resistance. In contrast, the smaller cube version, worked like the cube of force in all respects, so it would only form around the caster to protect them, but was safe against such attacks. However, to know this, you had to take a look at how cube of force worked.
This dual mode has been retained throughout editions but the difference in targeting and function was lost along the way with the two different spell names. I think this is not surprising, as this difference in intended use is not obvious by reading the spell text, and thus easily overlooked.