The flat spectrum radio quasar CTA 102 (redshift 1.037) exhibited a tremendously bright 4-months long outburst from late 2016 to early 2017. In a previous paper, we interpreted the event as the ablation of a gas cloud by the relativistic jet. The multiwavelength data have been reproduced very well within this model using a leptonic emission scenario. Here we expand that work by using a hadronic scenario, which gives us greater freedom with respect to the location of the emission region within the jet. This is important, since the inferred gas cloud parameters depend on the distance from the black hole. While the hadronic model faces the problem of invoking super-Eddington jet luminosities, it reproduces well the long-term trend and also days-long subflares. While the latter result in inferred cloud parameters that match those expected for clouds of the broad-line region, the long-term trend is not compatible with such an interpretation. We explore the possibilities that the cloud is from the atmosphere of a red giant star or comes from a star-forming region that passes through the jet. The latter could also explain the much longer-lasting activity phase of CTA 102 from late 2015 till early 2018.