Second-order ZFC is nearly categorical, except that it does not determine the 'height' of the cumulative hierarchy (intuitively speaking). However, additional axioms can be added to second-order ZFC to provide a categorical axiomatization, e.g. specifying that there are no inaccessible cardinals (or that there is exactly one, etc); see this previous answer for details on this background assumption [1]. However, once a particular maximum level has been specified for the cumulative hierarchy (by an additional axiom), does this risk creating an inconsistency with the axiom of replacement, since the range of a function (used in replacement) could potentially include sets arbitrarily high up in the stages of the cumulative hierarchy (where the height of the hierarchy has been fixed by the maximum inaccessible cardinal specified in the added axiom)? Admittedly, this is arguably already a problem for the iterative conception of sets even without an additional axiom, but I'm wondering if it's particularly problematic when an axiom is added (to achieve categoricity) which 'arbitrarily' restricts the height of the cumulative hierarchy (so that a set created by replacement which exists at some level of the hierarchy, does not exist in the 'cropped' hierarchy determined by the new axiomatization)?
[1] What axioms need to be added to second-order ZFC before it has a unique model (up to isomorphism)?
As the answer by Jack indicates, the usual form of replacement quantifies only over definable functions. But it would be equally possible to make a genuinely second-order axiom of replacement that quantifies over all functions whose domain is a set in the model and whose range is contained in the model.
Suppose that there is an inaccessible cardinal κ in the metatheory, and let $M=V_\kappa$(so $M$ is a model of at least full second-order Zermelo set theory with the axiom of choice).
To show that $M$ satisfies the second-order replacement axiom, suppose that $F$ is any function in the metatheory from some set $A∈M$ to $M$. Then, again in the metatheory, the range of $F$ is also a set of rank less than $\kappa$, because $\kappa$ is inaccessible. So the metatheory sees that $F \in V_\kappa$. But that means that $F \in M$, by definition, so the range of $F$ is also in $M$. Hence $M$ does satisfy the second-order replacement axiom.
This shows that if there is an inaccessible in the metatheory then second-order Zermelo set theory with choice and with the second-order form of replacement mentioned above is consistent.
In particular, we could take $\kappa$ to be the first inaccessible in the metatheory. So the theory in the previous paragraph is consistent with "there is no inaccessible".