Euphemism is not simply an agreeable phrasing—if it were, then every tactful or diplomatic phrasing would be euphemistic; it’s an indirect reference to a disagreeable topic.
The OED definition for euphemism:
That figure of speech which consists in the substitution of a word or expression of comparatively favourable implication or less unpleasant associations, instead of the harsher or more offensive one that would more precisely designate what is intended.
The Concise Oxford Companion to the English Language defines it as:
a mild, comforting, or evasive expression that takes the place of one that is taboo, negative, offensive, or too direct.
American Heritage Dictionary defines it as:
A mild, indirect, or vague term for one that is considered harsh, blunt, or offensive
In this case, the disagreeable or offensive subject is death, so we seek to indirectly say he died. We can say he passed away or he rests in peace; that is euphemism. We can also say he kicked the bucket; that is also euphemism as it avoids directly referring to death. The fact that it would inappropriate to use it in certain situations is irrelevant. A euphemism is always euphemistic, regardless of the situation in which it is uttered. There are cases where kick the bucket is not inappropriate, but it is still euphemistic.
It works the other way too. There’s a scene the TV series The Wire where three adult men are sitting around a table talking. One, a university professor, stands up and says, “I have to go tinkle,” and leaves. When he’s gone, the other two break out in laughter. Tinkle is a euphemism for urination, but in this case it is inappropriate because it is a nursery register, not something that a grown man would say to another. But it remains a euphemism.