I think this: https://en.wikipedia.org/wiki/Reflection_phase_change gives you some of the information you are looking for, i.e. a sound wave propagating through air in a cavity reflects with no phase change at a solid interface, and with a $\pi$-phase change at the open end of the cavity.
What the article doesn't tell you is whether it is talking about pressure or displacement, so here is how I remember it intuitively:
The inside of the open end of the cavity has to have the same pressure as outside. Therefore, you get a $\pi$ phase shift for the pressure (so that it cancels) at the open end. However, the displacement has no such limitation.
The closed end of the cavity has a fixed position. Therefore, the displacement has to be 0, which means that it experiences a $\pi$ phase shift at the closed end. However, the pressure has no such limitation.
Also, if I remember well, when you solve the wave equations for sound, you'll see that the nodes (i.e. positions with 0 amplitude) for pressure are the positions where you have maximum amplitude for displacement and vice-versa.
Therefore, the conclusion is this:
- At an open end, pressure is 0 (or more precisely, the difference of pressure with steady state) but displacement is maximum
- At a closed end, displacement is 0, but pressure is maximum.
Hope it answers all your questions!