A p-value is the probability to obtain a statistic that is at least as extreme as the one observed in the sample data when assuming that the null-hypothesis ($H_0$) is true.
Graphically this corresponds to the area defined by the sample statistic under the sampling distribution which one would obtain when assuming $H_0$:
However, because the shape of this assumed distribution is actually based on the sample data, centering it on $\mu_0$ seems like an odd choice to me.
If one would instead use the sampling distribution of the statistic, i.e. center the distribution on the sample statistic, then hypothesis testing would correspond to estimating the probability of $\mu_0$ given the samples.
In that case the p-value is the probability to obtain a statistic at least as extreme as $\mu_0$ given the data instead of the above definition.
Additionally, such an interpretation has the advantage of relating well to the concept of confidence intervals:
A hypothesis test with significance level $\alpha$ would be equivalent to checking whether $\mu_0$ falls within the $(1-\alpha)$ confidence interval of the sampling distribution.
I thus feel that centering the distribution on $\mu_0$ could be an unneccessary complication.
Are there any important justifications for this step which I did not consider?