In a narration from Prophet ﷺ, he said,
“Seek profit for the wealth of the orphans, and do not let it get used up by obligatory charity.” (AS-Sunan Al-Kubraa by Bayhaqy 7413),
and in the Muwatt-tta’ of Imaam Maalik, Maalik said that it reached him that ‘Umar ibn Al-Khatt-ttaab said, “Invest in business the wealth of orphans and do not let it be all taken by obligatory charity.” (1:251) Thus, in investing the wealth, there is no doubt that this is showing orphans kindness and other gestures, and showing orphans kindness is more deserving, as is taking care of their wealth and investing it. If a guardian oversees this wealth and invests it, he has the right to take something from it which is acceptable, but if he is not in need of it, and leaves it, then this is much better. If he is in need, then it is alright for him to take what is proportional to the work he put in.