I have experience selling ebooks on three platforms, sorted from most recent:
Clickbank is kinda scammy in my experience but it was the first easy-to-use platform (back in 2006). My book was definitely stolen/reposted from there but in hindsight I probably should’ve let that happen as the book was filled with affiliate links.
Gumroad works well and I continue to sell a book there, as well as Amazon. Gumroad is definitely more niche. Amazon has the biggest reach, obviously.
My advice is to assume your book will escape its confines and plan accordingly. That’s not such a bad thing if the book raises your profile and/or can upsell to other goods or services.