I don't know if there's really a way of saying "though it is not what I asked for, it is so kind of you" that's not at least a little rude or sarcastic.
You could use it in the sense that you ask someone for a 2-litre bottle of pop and they bring you a 500ml bottle.
"It was the small one you asked for?"
"No, but it's fine anyway. Size isn't everything."
The expression must refer literally to the size; you couldn't use it if something was the wrong colour for example. Although it could refer to any object there is always a hint of sexual innuendo with this expression.