For one termux-open-url takes some time to execute, giving me this error:

Second thing, termux-open-url only accepts valid url's, so the address must be prepended with the protocol (see termux/termux-app#1684), so be wary of that in case you'd want to implement #3.