No: let $X$ be the union of the coordinate axes in the affine plane. As over $\mathbf{C}$, the answer is affirmative on a connected normal analytic space. Hint: prove connectedness is in any rigid-analytic space that connected components are witnessed via finite linked chains of connected affinoid opens (and after thereby reducing to the affinoid case, assume smoothness if you are unfamiliar with excellence)the excellence properties of affinoid algebras). This
The answer is applicable to meromorphic functions as well, but proving that requires more care (e.g., one has to first figure out how to appropriately define the concept of meromorphicity and prove some basic features of it).

