Praise be to Allah.
There is no contract in Islamic sharee‘ah which allows a person to pay money to another person so that after a certain period he will get a guaranteed profit or return. This – no matter what people call it – is haraam according to scholarly consensus. It is either one of the forms of riba or one of the forms of prohibited, corrupt partnerships.
The process mentioned in the question does not come under the heading of buying shares in a share company; rather it is more akin to haraam types of bonds.
The share gives the buy partnership in the company, and the one who owns the share is a partner in the company whether it makes a profit or a loss, because he is a partner and an owner of a part of the company.
In the case of a bond, however, it represents a debt and a loan to the company. The bond holder receives a fixed return regardless of whether the company makes a profit or not, but he does not bear any of the company’s losses, because he is not a partner in the company.
Dealing with these bonds is prohibited according to Islam, because this is a loan in return for interest as agreed upon, which comes under the heading of riba (usury) which Allah, may He be exalted, has prohibited and warned against, as He says (interpretation of the meaning):
“O you who believe! Fear Allah and give up what remains (due to you) from Ribaa (from now onward) if you are (really) believers.
279. And if you do not do it, then take a notice of war from Allah and His Messenger but if you repent, you shall have your capital sums. Deal not unjustly (by asking more than your capital sums), and you shall not be dealt with unjustly (by receiving less than your capital sums)”
It says in a statement of the Islamic Fiqh Council:
Bonds which represent a commitment to pay the face value plus interest, or conditional benefits, are haraam according to sharee‘ah, whether one is buying, selling or handling them, because they are considered to be interest-based loans. This applies whether they are issued by private companies or by public bodies run by the state. The fact that they are forbidden is not affected by giving them other names such as “certificates”, “investment documents” or “savings”, or calling the interest “profit”, “commission” or “returns”.
End quote. Qaraaraat Majma‘ al-Fiqh al-Islami, p. 126
And Allah knows best.