Is There A Restriction On Gift/ Hiba
Your understanding is correct. A person has the legal authority to transfer their property according to their choice, but ethically, they are responsible for not doing injustice to any of their children. If they did, they would be answerable to God for this act of injustice. God says after describing the law of inheritance: مِنۡۢ بَعۡدِ وَصِیَّۃٍ یُّوۡصٰی بِہَاۤ اَوۡ دَیۡنٍ ۙ غَیۡرَ مُضَآرٍّ ۚ وَصِیَّۃً مِّنَ اللّٰہِ ؕ وَ اللّٰہُ عَلِیۡمٌ حَلِیۡمٌ after the execution of any will bequeathed and any [outstanding] debts – without harming anyone.
Possessing authority does not excuse a person from committing injustice. Having authority is a test of one’s fairness, not a license to act unjustly. The Prophet also discouraged giving away all of one’s wealth in charity while neglecting the needs of one’s children. If injustice in bequeathing is not allowed, it is obviously not allowed in Hiba, too.