In some sense, it’s literally like “Now I’ve done it…”
That’s literally all it means. しまう just means “to do completely” and it’s often used with a sense of regret.
The reason it gets translated as “damn it” and other expletives is just because it can be used in situations where Americans (or other English speakers) would swear.
It’s not… like… an elegant thing to say, but it’s not like people will be covering children’s ears or anything.