A container that is magically larger on the inside than on the outside is something that appears more or less often in fiction. What is the first fictional container that, for some reason or another (maybe just humor) is magically smaller on the inside?
Probably not the first example, but in Howl's Moving Castle by Diana Wynne Jones the titular castle itself is much smaller on the inside than the outside. Outside it appears to be a "great, ugly castle", "far too tall for its height" "built of huge black blocks" but inside there is just a quite small workroom-cum-kitchen, a bathroom, and two bedrooms up a rickety flight of stairs. The interior is actually that of an entirely different smallish house, connected to the castle exterior by magic.
One example that comes to mind is John Malkovich.
In the 1999 movie Being John Malkovich, characters who go to the seven-and-a-halfth floor of the Mertin-Flemmer building find themselves in a miniature office building floor (literally, not magically, smaller, so far as we know). But within that floor is a small door, and entering that door puts the visitor behind the eyes of John Malkovich. As in the image above, the visitor sees through the eyes as if they were a portal in front of them - the visitor is, in some magical way, small enough to fit behind John Malkovich's eyes.
Although I am not sure it's exactly what you are looking for, The Logical Magician series from 1995 has a mathematician using his mathematical knowledge to great effect when he is introduced to magic, it turns out being able to naturally think and reason in altered geometric spaces and higher dimensions is fantastic for magic innovation. At some point an actual Klein bottle is created, which is a closed bottle that takes up space but has zero volume. It's impossible to create in 3 dimensions without magic.
I would not be surprised if there was an earlier work that played off of the novel geometry of Klein bottles as well.