A homebrew creature, maybe
If the creature's stat block says "this creature is immune to damage from magical attacks" then yes, your +1 weapon is a magical attack and it won't hurt the creature.
I don't believe there are any official creatures in 5e that have this ability. Normally, when a creature is immune to magic, its stat block will say something like "immune to spells."
If the DM told you what monster this is, you could look it up and see what its stat block says. If it's homebrew, then the DM's ruling is authoritative.
And this is a bit weird, but probably fine
In D&D 5e, magical attacks beat basically anything, so it's weird to see a monster that violates that rule.
On the other hand, it's not hard to deal with now that you know it can happen. You'll just have to carry a backup shortsword that isn't magical. Luckily, nonmagical shortswords are cheap.