idiom

With one's tail between one's legs.

Theme: humility Keyword: dog

means

In a state of embarrassment or defeat.

also

Tail between one’s legs

Example

He returned with his tail between his legs after boasting that he would win.