(1) Background: Previous studies have raised concerns about a potential increase in pancreaticobiliary cancer risk after cholecystectomy, but few studies have focused on patients who undergo cholecystectomy after receiving endoscopic retrograde cholangiopancreatography (ERCP) for choledocholithiasis. This study aims to clarify cancer risks in these patients, who usually require cholecystectomy, to reduce recurrent biliary events. (2) Methods: We conducted a nationwide cohort study linked to the National Health Insurance Research Database, the Cancer Registry Database, and the Death Registry Records to evaluate the risk of pancreaticobiliary cancers. All patients who underwent first-time therapeutic ERCP for choledocholithiasis from 2011 to 2017 in Taiwan were included. We collected the data of 13,413 patients who received cholecystectomy after endoscopic retrograde cholangiopancreatography and used propensity score matching to obtain the data of 13,330 patients in both the cholecystectomy and non-cholecystectomy groups with similar age, gender, and known pancreaticobiliary cancer risk factors. Pancreaticobiliary cancer incidences were further compared. (3) Results: In the cholecystectomy group, 60 patients had cholangiocarcinoma, 61 patients had pancreatic cancer, and 15 patients had ampullary cancer. In the non-cholecystectomy group, 168 cases had cholangiocarcinoma, 101 patients had pancreatic cancer, and 49 patients had ampullary cancer. The incidence rates of cholangiocarcinoma, pancreatic cancer, and ampullary cancer were 1.19, 1.21, and 0.3 per 1000 person-years in the cholecystectomy group, all significantly lower than 3.52 (p < 0.0001), 2.11 (p = 0.0007), and 1.02 (p < 0.0001) per 1000 person-years, respectively, in the non-cholecystectomy group. (4) Conclusions: In patients receiving ERCP for choledocholithiasis, cholecystectomy is associated with a significantly lower risk of developing pancreaticobiliary cancer