Hello,
Welcome to Microsoft Q&A.
if you do not publish the package in the store, the code for checking the store update will not actually take effect.
If you have other published packages in the Microsoft Store, you can use it for testing.
I simply tested the code in the document (via an application that already exists in the store) and it works fine.
Thanks.