Gas estimation value on `ContractTrapped` prevents call execution
If a contract contains an assertion which fails by default ‒ i.e. the contract traps for the RPC which does the gas estimation ‒ then the gas estimation goes crazy and the call cannot be executed with default settings. This does not happen in the polkadot-js UI.
Assertions in contracts are typically used to make sure that the contract execution is reverted. I've uploaded a minimal contract, which you can use for reproduction here: assertfalse.contract.zip.
It just contains a constructor and this method:
#[ink(message)]
pub fn assert_false(&self) {
assert!(false);
}
When you open the "Execute assertfalse (instance)" page the gas estimation will be set to a red
127.001s execution time
6350.067% of block time

It's not possible to execute the method with these settings, the "Call" button is disabled. If the "Max Gas Allowed" is set manually it works.
In the polkadot-js UI it works fine:

My hunch is that there is maybe some default value which is used on ContractTrapped returned by the RPC and this one is way too large?