If the two thousand riyals would really be taken by the bank employee, this may be permissible in return for what he did on the basis of his position, or it may be haraam because it is a bribe and could be taken in return for forgery and lying. It depends on the following possibilities:
If the bank employee was using his position and status and he interceded with the people in charge, then he took something in return for that, this is what is known to the fuqaha’ as the price of using one's status and position, and it is a subject of scholarly dispute. Some of them are of the view that it is permissible, as may be understood from the words of the Shafaa‘is and Hanbalis; others are of the view that it is not permissible or is makrooh, or the ruling may differ according to circumstances. This is the view of the Maaliki madhhab.
It says in Mughni al-Muhtaaj (Maaliki), 3/35: al-Maawardi said: If he says to another person: Borrow one hundred for me and I will give you ten, this is ja‘aalah. End quote. What that means is that it is permissible for you. Ja‘aalah is like fees. But it may be subject to different rulings.
It says in al-Rawd al-Murbi‘ (Hanbali), in the chapter on loans: If he says, Borrow one hundred for me and I will give you ten, it is valid because it is payment in return for what he used of his position or status. End quote.
It says in al-Insaaf (Hanbali): If he agreed to give him something in return for borrowing for him on the basis of his position or status, that is valid, because it is in return for what he did on the basis of his position or status only. End quote.
So if the employee made getting a loan easy for your friend in this way, it seems that there is nothing wrong with it. There is also nothing wrong with you taking five hundred riyals that were given to you.
If it was part of the employee's job to give loans to those who meet the conditions, and he refused to give a loan unless he got something for that, then this is a bribe and is haraam.
If he was obtaining a loan for your friend by means of lying or forgery, then his action is haraam and the money that he took for that is haraam, and it is not permissible for you to intermediate between them in this case.
If you are going to take this two thousand and you lied to your friend by telling him that it was for the bank employee, then this is a lie and is haraam, and it is not permissible for you to take this money. It seems that if your friend knew that it was for you, he would not have given you five hundred riyals extra, and what you should have done is tell him the truth. The Prophet (blessings and peace of Allah be upon him) said: “No man’s wealth is permissible unless he gives it willingly.” Narrated by Ahmad, 20172; classed as saheeh by al-Albaani in Saheeh al-Jaami‘, 7662.
So you have to correct you a mistake and repent from this sin and from consuming unlawful wealth, and you have to return this two thousand to your friend. There is nothing wrong with saying something ambiguous without bluntly telling him that you lied to him; rather you may say that the bank employee did not take it, for example. If he decides to give it or some of it to you, then there is nothing wrong in accepting it.
It is stipulated that this loan should be a shar‘i loan which does not involve any interest or penalties for late payment, otherwise it is a riba-based loan which it is not permissible to take or to act as an intermediary in order to obtain it, for yourself or for the bank employee, because that involves helping one another in the major sin of riba, for which the one who does it is cursed.
And Allah knows best.