Ambiguity in definition of primary valency in Werner's theory
George B. Kauffman has edited an excellent book, &quot;Coordination chemistry: A century of progress.&quot; It was published as an ACS Symposium Series. In the chapter, he writes, &quot;If history teaches us anything, it teaches us that the latest view is not always the best and that change is not always progress.&quot; I may add that there is no authority in science. I am glad that you challenged textbooks.
Basically, in Werner's time, the prevalent theory of the complexes was that the complexes are chained compounds, which was not consistent with the solution conductivity and optical isomerism of the complexes. Werner proposed the primary and secondary valence concept.
Contrary to most modern chemistry books, including that respectable Alan G. Sharpe's texts, Werner's primary valence matches the &quot;oxidation&quot; state of the metal in simple cases. The oxidation state matches Werner's primary valence when there is no anion in the coordination sphere. The textbook version of Werner's story fails for the type of compounds you just asked, such as $\ce{[Co(NH3)5Cl]Cl2}$.
Here the oxidation state is indeed 3. However, Werner's primary valency of this compound is 2.
Kauffman mentions

Werner postulated two types of valence—Hauptvalenz, primary or ionizable valence, and Nebenvalenz, secondary or nonionizable valence. According to Werner, every metal in a particular oxidation state, that is, with a particular primary valence, also has a definite coordination number, that is, a fixed number of secondary valences that must be satisfied. Now, whereas primary or ionizable valences can be satisfied only by anions, secondary or nonionizable valences can be satisfied not only by anions but also by neutral molecules containing donor atoms such as nitrogen, oxygen, sulfur, and phosphorus.

The keyword is that primary valence is the ionizable valence. The ionizable valence of the complex in question is 2. $\ce{[Co(NH3)5Cl]Cl2}$ would generate three ions in solution $\ce{[Co(NH3)5Cl]^{2+}}$ and two $\ce{Cl-}$. These experiments were easily doable in Werner's time by conductivity measurements. Secondly, as discussed in the comments, argentometric titrations would show only two chloride ions rather than three.