$\mathcal A^{\mathcal A}\sim\mathcal B^{\mathcal B}\implies\mathcal A\sim\mathcal B\ ?$ (Does A^A ~ B^B imply A ~ B? --- A, B categories)
(Edited to reflect your edit to the question!)
The answer to your original statement (without the "nonempty" assumption) is no because we can let $A=\varnothing$ and $B=\ast$. Their endofunctor categories are each discrete with one object, but the categories themselves are not equivalent.
The question becomes a lot trickier when you add "nonempty" to the statement, but I think the answer is still no. I believe the following is a counterexample:
Let $G$ be an abelian group such that $G\times G\cong G$ and $\text{End}(G)$ is infinite. (So, for example, let $G=\Pi_{n\geq 1} \mathbb{Z}$). Let $C$ be the one object category corresponding to $G$. Notice that $C$ is not equivalent to $C\sqcup C$ because $C$ has just one object and $C\sqcup C$ has two non-isomorphic objects. But let's compare their endofunctor categories.
First, let's describe $C^C$. The objects in $C^C$ are precisely the homomorphisms $G\rightarrow G$. Each morphism in $C^C$, i.e., each natural transformation $\phi\Rightarrow \psi$, is a choice of $g\in G$ such that $g\phi(h)=\psi(h)g$ for all $h$, but since $G$ is abelian, that means $\phi=\psi$. Thus, $C^C\cong \sqcup_{\text{End}(G)} C$. Now, observe that $(C\sqcup C)^C\cong C^C \sqcup C^C$ since $C$ has one object. Putting these together and using the fact that $C^{(-)}$ sends colimits to limits, we have
$(C\sqcup C)^{C\sqcup C}\cong (C\sqcup C)^C\times (C\sqcup C)^C \cong (C^C \sqcup C^C)\times (C^C\sqcup C^C)\cong C^C \times C^C$,
where the last isomorphism comes from $C^C$ being an infinite coproduct. But then
$C^C\times C^C \cong (\sqcup_{\text{End}(G)} C) \times (\sqcup_{\text{End}(G)} C)\cong \sqcup_{\text{End}(G)\times \text{End}(G)} (C\times C)\cong \sqcup_{\text{End}(G)} C\cong C^C$
(Note: In this example, the endofunctor categories are in fact isomorphic, not just equivalent.)
Here is another counterexample, also using groupoids.
For a group $G$ I will use the notation $G$ also for the corresponding one-object groupoid. If $C$ is the disjoint union of groups $G_i$ and $D$ is the disjoint union of groups $H_j$ then $C^D$ is the product over $j$ of the disjoint union over $i$ of the groupoid $G_i^{H_j}$. If $G$ is an abelian group then $G^H$ is the disjoint union, over all homomorphisms $H\to G$, of $G$.
Putting all of this together, one can work out a description of $A^A$ when the groupoid $A=\infty 1\coprod \infty\mathbb Z$ is the disjoint union of countably infinitely many trivial groups and countably infinitely many infinite cyclic groups. It comes out be the disjoint union of the following groups, each occurring a continuum's worth of times: free abelian groups of all finite ranks, and a countably infinite product of $\mathbb Z$'s.
Now let $B=\infty 1\coprod \infty\mathbb Z\coprod \mathbb Z^2$ be the disjoint union of $A$ with one copy of $\mathbb Z^2$. Then $B^B$ comes out to be isomorphic to $A^A$.