All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
What some parents do, like gifting some of their male or female children on the basis that it is their share from the inheritance once the father dies, is not valid as an inheritance, and their share in the inheritance is not waived on the basis that they took whatever they took in exchange for their share in the inheritance. Rather, their right is only established after the death of the parent, because before his death, they are not entitled to any right or to ownership of any property.
Also, it is not valid to consider it to be a gift, because it is not a gift according to the Islamic definition of a gift. A gift is defined by the scholars as "ownership without compensation," while, here, it was in return for the beneficiary's share in the inheritance, presumably. Since it is neither valid as an inheritance nor as a gift, then making the daughter own whatever she was gifted is void, and she is obliged to return what she took from her father to the inheritance.
Fataawa Al-Fiqhiyyah Al-kubra by Ibn Hajar Al-Haytami, from the Shaafi’i School, reads:
"If one divides whatever he possesses among his children: if he does that by making each of them own something as a valid gift that fulfills its conditions of proposal, acceptance, and the beneficiary actually taking possession of the gift and disposing of it as its owner, or being given authorization to do so, and each child actually took the gift that was gifted to them into their possession, and this was when the donor was in sound health (not in a fatal illness or on his death bed), then this is permissible and each of them possesses whatever is in his hand solely and independently, and none of his siblings shares it with him … but if he divided what he possesses amongst them without making them own it according to Shariah (as described above), then such a division is invalid."
As for the first floor that you built above the house of the heirs with their permission, then if they had given you permission to build with the intention of making you own the first floor, then the first floor is your property and it has nothing to do with the inheritance; so it is yours alone. When the entire house is sold, then the heirs have the right in the value of the ground floor only without the first floor that you had built.
However, if they had given you the permission to build with the intention of lending you the first floor, and not with the intention of making you own it, then this is considered as a loan which ends by the end of the period from benefitting from the construction. Only the builder has the right to benefit from that period.
At the end of the loan period, the builder is entitled to the value of the construction from the rest of the heirs; either when it is demolished and sold as bits and pieces, or with its actual market price in its state as completely built now, according to two views of the scholars.
The view that the builder is entitled to the value of the construction with its actual market price in its state as completely built now and not as demolished and sold in bits and pieces is a strong and considerable view; and it is the view that we consider to be the correct one in our recent fatwas, as this is fair to the builder and takes his circumstances into account. Therefore, in case you sell the house, you are entitled to have the value of the first floor at its market price in the state in which it is now.
Allah knows best.