Hi Chen Lim,
Based upon your question, sometimes transient issues can cause timeouts. Wait a few minutes and then try running the command again.
Run the Azure CLI commands from your local machine instead of the web terminal and ensure that your account has the necessary permissions to create role assignments, you may need Owner or User Access Administrator permissions on the subscription or resource group.
Make sure your Azure CLI is updated to the latest version, as issues are often resolved in newer releases. Additionally, you can add --debug to your command to get more detailed logs, which may help you identify the cause of the timeout.
If the information is helpful, please consider by clicking the "Accept Answer & Upvote" on the post.
Thank you.