"Error loading extension" for POS UI Extension after Getting Started Guide

The issue got resolved when I followed this question https://community.shopify.com/post/2551868 and upgraded the Shopify CLI to the latest version.