Let $T$ be a first order theory and $\mathcal{M}\models T$ and let $A\subseteq M$ and $\bar{a},\bar{b}\in M^n$.
Question. Is the following statement always true and why? $$\text{tp}^{\mathcal{M}}(\bar{a}/A)=\text{tp}^{\mathcal{M}}(\bar{b}/A) \Longleftrightarrow \exists f\in Aut(\mathcal{M}/A), f(\bar{a})=\bar{b}$$
No, this is almost never true!
It's probably clear to you that one direction always holds: if $f\in \text{Aut}(M/A)$, and $f(a) = b$, then $\text{tp}(a/A) = \text{tp}(b/A)$.
We say a model $M$ is homogeneous if for any $A\subseteq M$ with $|A| < |M|$ and any tuples $a$ and $b$, if $\text{tp}(a/A) = \text{tp}(b/A)$, then there is an automorphism $f\in \text{Aut}(M/A)$ such that $f(a) = b$.
This is weaker than the condition in your question, because of the restriction on cardinalities: $|A|<|M|$. But even in this weaker form, it's not always true: most theories have lots of non-homogeneous models.
There are some classes of models that are homogeneous, which model theorists like a lot. Every saturated model is homogeneous, and in particular monster models are homogeneous. The equivalence in your question is used all the time for subsets and tuples from the monster model. Also, prime models for countable theories are homogeneous (when they exist). The unique countable model of an $\aleph_0$-categorical theory is homogeneous (being both saturated and prime).