I hope you’ll get much better comments but so far there’s nothing so to fill the void:
I kept alive a scrawny apple tree in a large pot on my apartment balcony for 20 years, because it grew from a Gala apple seed planted by my daughter in preschool. (Obviously it didn’t make Gala apples, but it made some pretty flowers and tiny crabapples that were sweeter than you’d expect.)
I learned that apple trees are prone to fungus and really like good drainage. If I were doing it again I’d use something lighter than potting soil, like Orchid or even Desert Mix. Not sure how that translates to in-the-ground gardening but I do think you’re right about it being waterlogged. I’m sure you could dig in something around it to let more dry air into the soil and let excess water drain.
I have a blueberry bush too, and it’s much hardier.
Lookup fire blight.
Based on this short article, I’m going to guess it’s either waterlogged or not getting enough potassium. It is pretty dense soil and I haven’t checked the pH recently (though I should–also have blueberries growing nearby).