Let's be clear, this will happen regardless if you get the notification or not. Your purchases are going to be analyzed down to the second you made the purchase.
> ... when a neighbor orders from a restaurant ...
More to the point, it stays "safe" until (let's be real) there is a data breach. That's less of a privacy nightmare when you consider there's a much smaller range of actors that will use the data from a breach. Contrariwise, the ability to just query their API for some of that data gets turned into an app that someone's stalker ex downloads so they can proceed with stalking.
Privacy nightmare indeed.
"Neighbors" is a loose term. It doesn't literally mean only the people you live immediately next to. Aside from the fact that the person receiving the notification has no information about the radius this notification was triggered by, there would also not be identifying information in the notification. You're not being told "That person across the hall, John Smith, bought a large pizza from ABC pizza ten minutes ago and is on his way to pick it up now".
A stalker would get no actionable information from "Someone in your area ordered sushi from XYZ".
There is also no indication that this would be available in any sort of publicly scrapable API, I really don't know where you pulled that from. Push notifications, by definition, are not queried for.
If a platform created this feature I imagine they would also prime the pump with dishonest notifications about “a neighbor ordered from X restaurant”, with the expectation that they could parlay a single fake order into many real ones.
That’s a privacy nightmare.