ABSTRACT Many black holes detected by the Laser Interferometer Gravitational-wave Observatory (LIGO) and the Virgo detectors are multiple times more massive than those in X-ray binaries. One possibility is that some binary black holes (BBHs) merge within a few Schwarzschild radii of a supermassive black hole (SMBH), so that the gravitational waves (GWs) are highly redshifted, causing the mass inferred from GW signals to appear higher than the real mass. The difficulty of this scenario lies in the delivery of BBH to such a small distance to a SMBH. Here we revisit the theoretical models for the migration of compact objects (COs) in the accretion discs of active galactic nuclei (AGNs). We find that when the accretion rate is high so that the disc is best described by the slim disc model, the COs in the disc could migrate to a radius close to the innermost stable circular orbit and be trapped there for the remaining lifetime of the AGN. The exact trapping radius coincides with the transition region between the sub- and super-Keplerian rotation of the slim disc. We call this region ‘the last migration trap’ because further inward, COs can no longer be trapped for a long time. We pinpoint the parameter space that could induce such a trap and we estimate that the last migration trap contributes a few per cent of the LIGO/Virgo events. Our result implies that a couple of BBHs discovered by LIGO/Virgo so far could have smaller intrinsic masses.