All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
A free person can neither be sold nor bought and it is not permissible for a person to sell himself. These narrations which you mentioned in the question were reported by the scholars in their books, but they mentioned that the consensus among the scholars is that this matter is forbidden.
Ibn Hajar was among those who reported this consensus in his book entitled "Fat'h Al-Baari", and Ash-Shawkaani reported it in his book "Nayl Al-Awtaar" when commenting on the Hadeeth narrated by Abu Hurayrah that the Prophet said: "Allaah said: 'I will be the opponent of three persons on the Day of Judgment: a man (i.e. a person) who gave a pledge in My Name and then acted treacherously, a man who sold a free person (as a slave) and consumed his price and a man who hired a laborer and got the full work done by him and did not pay him his wages.’”
For more benefit, please refer to Fataawa 83906, 84431, 85061 and 86042.
Allaah Knows best.