Over previous campaigns, an intense experimental program on advanced tokamak (AT) scenarios, has been carried out at the ASDEX Upgrade tokamak with full-tungsten wall. These discharges have been executed shortly after the boronization of the first wall to reduce the density and the impurity influx. The confinement level of such AT discharges was found to vary considerably, even when discharges with similar, if not identical, engineering parameters were carried out. This work investigates the causes of such confinement variations. Among all plasma quantities analyzed, confinement quality of AT scenarios correlates best with divertor neutral pressure, highlighting the key role of edge and scrape-off layer physics in determining global plasma confinement. In particular, it is found that the main cause of confinement degradation is the reduction of pedestal stability, which is in turn caused by the outward shift of the maximum density gradient position typically observed when the divertor neutral pressure increases. Owing to the low density of AT discharges under analysis, the movement of the maximum density gradient position can be caused entirely by changes in deuterium outgassing from the wall, which is strongly influenced by the boron layer deposited on the plasma-facing components and by the deuterium wall inventory. Finally, the predictive capability of confinement quality with the integrated model IMEP [Luda et al., Nucl. Fusion 60, 036023 (2020)] is tested on these discharges and shows promising results.