Optoelectronic devices consist of heterointerfaces formed between dissimilar semiconducting materials. The relative energy-level alignment between contacting semiconductors determinately affects the heterointerface charge injection and extraction dynamics. For perovskite solar cells (PSCs), the heterointerface between the top perovskite surface and a charge-transporting material is often treated for defect passivation(1-4) to improve the PSC stability and performance. However, such surface treatments can also affect the heterointerface energetics(1). Here we show that surface treatments may induce a negative work function shift (that is, more n-type), which activates halide migration to aggravate PSC instability. Therefore, despite the beneficial effects of surface passivation, this detrimental side effect limits the maximum stability improvement attainable for PSCs treated in this way. This trade-off between the beneficial and detrimental effects should guide further work on improving PSC stability via surface treatments.