The directed self-assembly (DSA) of diblock copolymers in laterally confining channels is a promising avenue to produce line-and-space patterns with a sub-25 nm pitch. In this study, we use self-consistent field theory (SCFT) to investigate the DSA of both cylinder- and lamella-forming diblock copolymers in narrow trenches with corrugated sidewalls. Specifically, we focus on systems that form lying-down cylinder monolayers or standing-up lamellae parallel to the sidewalls of the channel. While previous experimental and computational studies highlighted well-ordered cylinders and lamellae in smooth channels, undesirable defective structures are also observed. In the present study, the wetting sidewalls of the channels are no longer planar surfaces. Rather, we consider undulating sidewalls and investigate the effect of the rough surfaces on defectivity and line edge roughness (LER) in the self-assembled morphologies. We use SCFT to investigate the formation free energy of isolated, meta-stable defects of both cylindrical and lamellar block copolymers inside channels with sinusoidal corrugations along the sidewalls. Parametric studies include the effects of the amplitude and the frequency of the sinusoidal wall shape function, the placement of the defect core, as well as the number of cylinders and lamellae in channels of varying widths. Our simulations indicate that the relative decreases in defect formation energy in rough channels compared to smooth channels are strikingly similar in both cylinder- and lamella-forming melts. Furthermore, using a suitable order parameter and the center-to-center displacement of the self-assembled lines, our complex Langevin (CL) simulations (beyond SCFT) show that the propagation of the LER is sensitive to the amplitude and the wavelength of the sidewall shape function, with an even stronger dependence in the lamellar case compared to the cylindrical case. More broadly, our study reveals the dependence of line edge roughness propagation on a wide range of parameters that must be carefully controlled in order to successfully implement a directed self-assembly process with block copolymers.