How did AAVE dapp calculate the "maximum available withdraw" value?

Here are two examples. The monospace font denotes fields returned from the smart contract.

Acct1 Acct2
totalCollateralETH 0.4000003052288304 0.9001718403219797
totalBorrowsETH 0.000468559461273005
availableBorrowsETH 0.3587171520576787 0.6745928080128686
Dapp-displayed "Max available withdraw" ? 0.8795952861751706
Theoratical max withdraw with 75% LTV† 0.47833736981388631067 0..89954709437361569334
Max LTV calculated from "max available withdarw"‡ 2.28%

† Calculated from totalCollateralETH - totalBorrowsETH/0.75

‡ Calculated from totalBorrowsETH / (totalCollateralETH - "Max Available Widthdraw")

Sangalli sent me a message saying that there is a hidden "Safety Margin" which is a percentage (say, 85%) applied to the actual maximum available withdraw calculated from the need to maintain the maximum LTV.

But that raises 3 issues.

  1. If the "safety margin" is for safety, it should function in both two locations: borrowing new asset and withdrawing collateralised asset, since they affect the "health" factor to the same extent.
  2. If the safety margin is to protect the user from liquidation, it should be a factor applied to the minimum collateralisation needed (i.e. it should be a factor on maximum LTV, which is currently 75%), not to the actual withdrawable amount. As demonstrated in the second column (Acct2), the current calculation implemented by AAVE's dapp website would requires 44-times collateralisation, which is far beyond safety needs.
  3. I experimented with an account fully paid back, and it turned out that the available amount for withdraw is the full collateralised balance. The "safety margin" factor is not applied. It's weird how I can withdraw 100% if I had no debt, but if I have just 1wei debt i suddenly can only withdraw 85% of my collateral. If the 15% is a million dollar, that's a million dollar locked up for 1 wei.