Accreting millisecond pulsars show significant variability of their pulse profiles, especially at low accretion rates. On the other hand, their X-ray spectra are remarkably similar with not much variability over the course of the outbursts. For the first time, we have discovered that during the 2008 outburst of SAX J1808.4-3658 a major pulse profile change was accompanied by a dramatic variation of the disc luminosity at almost constant total luminosity. We argue that this phenomenon is related to a change in the coupling between the neutron star magnetic field and the accretion disc. The varying size of the pulsar magnetosphere can influence the accretion curtain geometry and affect the shape and the size of the hotspots. Using this physical picture, we develop a self-consistent model that successfully describes simultaneously the pulse profile variation as well as the spectral transition. Our findings are particularly important for testing the theories of accretion onto magnetized neutron stars, better understanding of the accretion geometry as well as the physics of disc-magnetosphere coupling. The identification that varying hotspot size can lead to pulse profile changes has profound implications for determination of the neutron star masses and radii.