I am using AzureCLI@2 task in my Azure DevOps YAML pipeline and simply adding
az config set bicep.use_binary_from_path=false
in the first line of inlineScript section of the task resolved the issue. No bicep install/uninstall was required.
Thanks @vandre for the suggestion.