A piecewise acoustic metasurface is designed to suppress the first mode while marginally amplifying the Mack second mode in a Mach 4 flat-plate boundary layer (BL) flow. The results of linear stability theory (LST) and the eN method demonstrate the stabilization effect and transition delay performance, respectively. However, the direct numerical simulation (DNS) results indicate that the designed broadband acoustic metasurface actually weakly excites the first mode with a slightly larger fluctuating pressure amplitude at the surface, which is in contrast to the analysis of LST. The discrepancies are found to lie in the ‘roughness’ effect caused by the recirculation zones inside the microslits and the alternating expansion and compression waves induced at the slit edges, which significantly amplifies the first mode. For further clarification of the competitive mechanism between the acoustic stabilization and ‘roughness’ destabilization effects of metasurfaces on the first mode, a carefully designed metasurface is installed at the maximum growth rate region, which excites the first mode on the metasurface but inhibits its development downstream.