If you're looking for a free upgrade to GoodNotes 5, please check out the instructions in this article, where we also covered all cases that still show a price for GoodNotes 5, even though you already bought GoodNotes 4:
If you have purchased GoodNotes on one of your iOS devices (iPhone, iPad) you can download it for free on all other iOS devices, as long as you're using the same AppleID.
The App Store sometimes falsely displays the purchase button. As long as you’re signed in to the same Apple ID, you can just go ahead and download the app, even though the App Store falsely displays the purchase button. If you have any doubt, please reach out to Appstore Support at https://getsupport.apple.com/?caller=cups. Select Apps & software > App Store > Subscriptions & purchases.
If you have already been charged, please have your Apple ID and your Order ID on your Receipt ready. AppStore agent will guide you and process your refund. You may select chat or schedule a call back whichever one is more convenient for you.