Emergency happens and you need the money back for family issue.
Eh...I feel like you shouldn't be giving away money you can't afford to lose. The terms was you'll get the money back after you reach your goals.
To me, you reneged on the terms of agreement first. Yes, it's your money, but it's basically a contract.
If you had put up your money in a CD or gave it to a money manager, you can't just take your money out unexpectedly because they take your money and put it to use, so you typically have to wait until term ends to get your money back, because that's when they plan to have your money available.
Yeah, it's not his money, but if you would not have reneged, he could have made preparations to have your money when your goal was reached, and you would not have this issue.
I think you need to take this L and wait until he returns the money.
And next time, not give money away that you can't afford to lose, but also, choose a better friend that is more financially stable.
These were two decisions that YOU made that put you in this situation. So you can't put it all on him.