The question: Why isn't 4-hydroxybenzoic acid formed along with salicylic acid in Kolbe's reaction?
There was a good answer provided to OP's question elsewhere using the cation sizes. However, it didn't provide the clear answer to the main question about why isn't 4-hydroxybenzoic acid formed when $\ce{NaOH}$ is used as a base. And there is also another question within the text: Why isn't salicylic acid formed along with 4-hydroxybenzoic acid when $\ce{KOH}$ is used as a base. Yet, OP has not provided any reference to these claims. Therefore, we can conclude that there are no scientific evidence to support them.
The Kolbe-Schmitt reaction is a carboxylation reaction of alkali metal phenoxides with carbon dioxide where hydroxybenzoic acids are formed. This reaction has been used for more than a century for industrial production of aromatic hydroxy acids such as salicylic acid (2-hydroxybenzoic acid). The accepted general mechanism of the formation of salicylic acid is presented in the bottom of following image:

The Kolbe-Schmitt reaction is a classical example of a reaction in which the nature of the reaction products is dependent on the alkali metal cation (Ref.1). For example, Marković et al. have investigated the mechanism of the Kolbe-Schmitt reaction (using phenolates of lithium, potassium, rubidium, and cesium phenoxides for the carboxylation) by means of computational analysis. It is shown that the reactions of all alkali metal phenoxides with carbon dioxide occur via very similar reaction mechanisms and the reactions can proceed in the ortho- and para-positions. The exception is lithium phenoxide, which yields only salicylic acid in the Kolbe−Schmitt reaction. It is found that the yield of the para substituted product increases with increasing the ionic radius of the alkali metal used.
Experimentally, under comparable conditions, lithium and sodium phenoxides have yielded salicylic acid as the major product (Ref.2). In contrast, potassium, rubidium, and cesium phenoxides have yielded the mixtures of salicylic acid and 4-hydroxybenzoic acid in different ratios (Ref.2 & 3).It is worth mentioning here that before the work in Ref.3 (1954), it was generally accepted that carbonation of sodium phenoxide leads to the formation of salicylic acid, while potassium phenoxide, under similar conditions, converts primarily into 4-hydroxybenzoic acid. However, Ref.3 has shown that this is not always true.
Because of these new insights the mechanism of the Kolbe−Schmitt reaction has been the focal point of both chemical and computational studies. A mechanism involving an intermediate chelate complex between carbon dioxide and metal phenoxide or 2-naphthoxide ($\ce{MOPh–CO2}$ and $\ce{MONaph–CO2}$ where $\ce{M}$ stands for a metal) is a postulation of early researchers. The presence of the intermediate $\ce{PhONa–CO2}$ complex was confirmed on the basis of the IR absorption spectra (Ref.4). Based on these results and others indicated that direct carboxylation is not an operative mechanism of the Kolbe–Schmitt reaction.
Mean time, a standpoint of initial formation of the $\ce{MOPh–CO2}$ or $\ce{MONaph–CO2}$ complex has been supported by a number of theoretical works (Ref.5). It was shown that the $\ce{CO2}$ moiety of the $\ce{MOPh–CO2}$ complex performs an electrophilic attack at the benzene ring in the ortho- and para-positions, leading to the new intermediates and final products (similar to pathway 1 in the image; e.g., Ref.5&6):

This mechanism clearly shows that the ortho-product is possible whenever $\ce{KOH}$ is used as a base. When 2-naphthol is the substrate, Ref.4 listed following results (Reference reaction is at the top of ist image):
$$
\begin{array}{c|ccc}
\hline
\ce{MOH}^a & \text{Rxn Temp.} & \text{Rxn Time} & \text{% yield ($\bf{1}$}) & \text{% yield ($\bf{2}$}) & \text{% yield ($\bf{3}$}) & \text{% SM recovery} \\
\hline
\ce{KOH} & \pu{293 K} & \pu{1 h} & 52.0 & 0.0 & 0.0 & 47.0\\
\ce{KOH} & \pu{503 K} & \pu{10 h} & 4.0 & 72.0 & 0.0 & 24.0\\
\ce{KOH} & \pu{523 K} & \pu{10 h} & 2.0 & 87.0 & 0.0 & 10.0\\
\ce{NaOH} & \pu{503 K} & \pu{10 h} & 14.5 & 71.5 & 2.5 & 11.0\\
\ce{NaOH} & \pu{523 K} & \pu{10 h} & \text{Trace} & 84.5 & 2.0 & 13.0\\
\hline
\end{array}\\
^a: \text{Carboxylation of pottasium and sodium 2-naphthoxides with $\ce{CO2}$ at $\pu{5 MPa}$ pressure.}
$$
The above Table shows there is not clear preference for pottasium and sodium 2-naphthoxides. The recent green approach shows adjusting conditions can make different isomers (Ref.7):

References:
- Zoran Marković, Svetlana Marković, Nebojša Begović, "Influence of Alkali Metal Cations upon the Kolbe−Schmitt Reaction Mechanism," J. Chem. Inf. Model. 2006, 46(5), 1957–1964 (https://doi.org/10.1021/ci0600556).
- Alan S. Lindsey, Harold Jeskey, "The Kolbe-Schmitt Reaction," Chem. Rev. 1957, 57(4), 583–620 (https://doi.org/10.1021/cr50016a001).
- Ogden Baine, G. F. Adamson, J. W. Barton, J. L. Fitch, D. R. Swayampati, Harold Jeskey, "A study of the Kolbe-Schmitt reaction. II. The carbonation of phenols," J. Org. Chem. 1954, 19(4), 510–514 (https://doi.org/10.1021/jo01369a006).
- J. L. Hales, J. Idris Jones, A. S. Lindsey, "Mechanism of the Kolbe–Schmitt reaction. Part I. Infra-red studies," J. Chem. Soc. 1954, 3145-3151 (https://doi.org/10.1039/JR9540003145).
- Svetlana Marković, Igor Đurović, Zoran Marković, "Revisiting the Kolbe–Schmitt reaction of sodium 2‑naphthoxide," Theoretical Chemistry Accounts 2015, 134, Article # 45 (9 pages) (DOI 10.1007/s00214-015-1648-0).
- Zoran Marković, Svetlana Marković, Nedeljko Manojlović, Jasmina Predojević-Simović, "Mechanism of the Kolbe–Schmitt reaction. Structure of the intermediate potassium phenoxide-$\ce{CO2}$ complex," J. Chem. Inf. Model. 2007, 47(4), 1520–1525 (https://doi.org/10.1021/ci700068b).
- Khakim A. Suerbaev, Mayliby K. Aldabergenov, Nurbolat Zh. Kudaibergenov, "Carboxylation of hydroxyarens with metal alkyl carbonates," Green Processing and Synthesis 2015, 4(2), 91-96 (https://doi.org/10.1515/gps-2014-0098).