Her best friend most likely knows that you asked her out and that you have a crush on her.
Whenever he jokes in the way he does, he may actually be referencing you.
It may not be a coincidence that he has mentioned “her crush” or talked about “gifting herself a boyfriend from the class” when he has walked passed you with her by his side.
He may be teasing her when he does this and wants you to hear it.
Perhaps he is trying to goad her to start looking at you as a romantic prospect.
Being that he is her best friend, he may feel comfortable teasing her in this way just to make her feel a little self-conscious.
Again, it is highly likely that she has told him that you asked her out.
It would not be a good idea to invite her to hang out just to take away your doubt.
She has already told you that she only sees you as a friend.
If you were to ask her to hang out, you would be doing so with the hope that she could start looking at you as more of a romantic prospect.
She doesn’t see you in this way.
The sooner you accept that, the quicker and easier it will be for you to move on.