It was proposed that the narrow \(P_c(4450)\) structure observed by the LHCb Collaboration in the reaction \(\Lambda_b\to J/\psi p K\) might be due to a triangle singularity around the \(\chi_{c1}\)--proton threshold at 4.45~GeV. We discuss the occurrence of a similar triangle singularity in the \(J/\psi p\) invariant mass distribution for the decay \(\Lambda_b\to J/\psi p \pi\), which could explain the bump around 4.45~GeV in the data. More precise measurements of this process would provide valuable information towards an understanding of the \(P_c\) structures.