You should definitely not use the chemical potentials of the constituent elemental materials in general, since for multi-elemental compounds they are not internally consistent. As an example, Pb and I would form an iodide, so it is not reasonable to assume the chemical potentials must be of Pb metal and I$_2$ gas.
I'm going to start with the fundamentals of how to calculate chemical potentials, but if you already know all this you can skip to the end of this post.
Concept
The chemical potential of an atom is basically the energy required to bring it into your chemical system from somewhere else. This energy depends on both your system and where the atom came from. The key to working out chemical potentials is to think about the two extreme elemental cases:
- there is a lot of element A compared to other elements, usually called "A-rich" conditions; or
- there is very little of element A compared to other elements, usually called "A-poor" conditions,
and similarly for the other elements.
If your system is A-rich, it means that there is so much of element A that some of it will be forced to be in its elemental form, simply because there aren't enough other atoms to form compounds with it. In this case, atoms of A are in chemical equilibrium with the elemental form, and its chemical potential $\mu_A$ is the same as the total energy per atom of its elemental form, $E(A)$:
$$
\mu_A = E(A) \tag{1}
$$
Binary Compounds
If there are only two elements in your material, A and B, and you only consider these two elements, then A-rich necessarily means B-poor, and vice versa. If you only consider the chemical reactions involving these elements, then in A-rich conditions the energy of the compound material determines the chemical potential of B. In other words, we assume that all the B has reacted to form the compound, and there is excess A which forms the elemental material.
Let us consider the case of a simple compound with chemical formula AB. Note that I'll be using A and B (and, later on, C) as generic chemical symbols, and B should not be interpreted as necessarily boron, nor C as carbon!
A-rich
In A-rich conditions, all the B reacts to form AB and there is still A left over. The excess A will form A's elemental compound.
2A + B $\leftrightarrow$ A + AB
Energetically, we have:
$$
2\mu_A + \mu_B = \mu_A + E(AB) \tag{2}
$$
i.e.
$$
\mu_B = E(AB) - \mu_A \tag{3}
$$
Since we're under A-rich conditions, and A is in chemical equilibrium with its elemental form, we use equation (1) and obtain:
$$
\begin{align}
\mu_A^\mathrm{A-rich} &= E(A)\\
\mu_B^\mathrm{A-rich} &= E(AB) - E(A) \tag{4}
\end{align}
$$
B-rich (A-poor)
In B-rich conditions, all the A reacts to form AB and there is still B left over. We follow the analogous process to the A-rich case, and assume that the excess B will form B's elemental compound.
A + 2B $\leftrightarrow$ AB + B,
which leads to:
$$
\begin{align}
\mu_A^\mathrm{B-rich} &= E(AB) - E(B)\\
\mu_B^\mathrm{B-rich} &= E(B) \tag{5}
\end{align}
$$
Note that, by definition, $\mu_A + \mu_B = E(AB)$ under all conditions.
What are the actual chemical potentials?
You'll notice that we now have two different values of $\mu_A$ (and $\mu_B$), corresponding to the two extremes of chemical conditions (A-rich and A-poor). This is correct, there is no single value for chemical potential which covers all environments; in fact, real environments are usually neither fully rich nor fully poor in their elements, so it is common practice to consider these values to be the extrema of the range of possible chemical potentials.
Ternary compounds
Adding another chemical element, C, makes the situation more complicated, but the basic idea is the same. Now if we have A-rich conditions, we have to consider whether there is more B than C, or vice versa.
Suppose we have a ternary compound, ABC. We now have more possible scenarios, depending on the relative abundance of all three elements. For the purpose of this discussion, let's consider the particular case where we have more A than B, and more B than C, i.e. "A-rich, C-poor".
In this case, all the C reacts with A and B to form ABC. The remaining B reacts with A to form AB. The excess A forms its elemental material. For example,
3A + 2B + C $\leftrightarrow$ A + AB + ABC
Energetically, we have:
$$
3\mu_A + 2\mu_B + \mu_C = \mu_A + E(AB) + E(ABC) \tag{6}
$$
i.e.
$$
\mu_C = E(ABC) + E(AB) - 2\mu_A -2\mu_B \tag{7}
$$
Since we're under A-rich conditions, and A is in chemical equilibrium with its elemental form, we use $\mu_A^\mathrm{A-rich}$ and $\mu_B^\mathrm{A-rich}$ from equation (4) and obtain:
$$
\begin{align}
\mu_C &= E(ABC) + E(AB) - 2\mu_A -2\mu_B \\
&= E(ABC) + E(AB) - 2E(A) - 2 \left\{E(AB) - E(A)\right\}\\
&= E(ABC) - E(AB)
\end{align}
$$
Notice that in this case, the energies of the elemental A and B have disappeared! That's a direct consequence of the fact that $\mu_A +\mu_B = E(AB)$. In fact, in chemical reaction terms the key reaction is:
AB + C $\leftrightarrow$ ABC
and as long as A and B are in chemical equilibrium with AB, it doesn't matter whether it's A-rich or B-rich.
The situation changes if there is more C, however, because then we need to consider the formation of AC or BC, depending on the relative abundance of A and B. Nevertheless, the basic procedure is exactly the same.
Multiple stoichiometries
Suppose A and B can actually form two different materials, A$_3$B$_4$ and A$_2$B. In these cases, it can usually be assumed that A$_2$B will form under A-rich conditions (since it uses more A per B) and A$_3$B$_4$ will form under A-poor/B-rich conditions (since it uses more B per A). This breaks the symmetry between the calculations for A and B, but the procedure is otherwise identical.
A-rich: 3A + B $\leftrightarrow$ A$_2$B + A
B-rich: 3A + 5B $\leftrightarrow$ A$_3$B$_4$ + B
which leads to
$$
\begin{align}
\mu_A^\mathrm{A-rich} &= E(A)\\
\mu_B^\mathrm{A-rich} &= E(A_2B) - 2E(A) \tag{8}
\end{align}
$$
and
$$
\begin{align}
\mu_A^\mathrm{B-rich} &= \frac{1}{3}\left(E(A_3B_4) - 4E(B)\right)\\
\mu_B^\mathrm{B-rich} &= E(B) \tag{9}
\end{align}
$$
respectively. Note that in equation (9) we have divided by 3 in the formula for $\mu_A$ because the compound has 3 A atoms per formula unit.
Real life
Remember that a real chemical environment will usually include more elements than simply the reagents. In the presence of air, oxygen will usually need to be considered (nitrogen is less reactive, so might be less important), and possibly water as well. In growth chambers, there may be contaminants from previous growth processes, or substrates; silicon is quite common. Hydrogen is extremely difficult to get rid of, even in ultrahigh vacuum. A more comprehensive study would also include these other elements from the environment.
Example: CsPbI$_3$
This is a ternary compound, so immediately we need to consider several combinations of rich and poor conditions. There may also be many possible binary compounds, for example the stable alloys of Cs and Pb. You should calculate the energy per formula unit of all the (likely) binary and ternary compounds, and determine the ranges of chemical potentials. In addition, you (correctly) point out that a realistic chemical synthesis may easily start from reagents with other elements, such as your HA and MH.
A comprehensive study of all these elements, and all the possible situations, can be very time-consuming. However, you can often use some reasonable assumptions to reduce the scenarios; for example, is it likely that you have H$_2$ gas at any point? You may be able to ignore the H-rich conditions and consider just the binary and ternary H-compounds. Will there really be elemental Cs left at the end of the actual experiments you're modelling? What compound(s) would you expect excess Cs to form? Perhaps you actually have experimental data, and already know what the Cs compounds are.
You also only care about the extremes of the chemical potentials, since they can fall anywhere within that range anyway, in practice - so if you can see that, for example, $\mu_H^\mathrm{Cs-rich}$ will lie somewhere in between $\mu_H^\mathrm{Pb-rich}$ and $\mu_H^\mathrm{I-rich}$, then there may be no need to compute it.
How comprehensive a job you need to do is up to you. There are always approximations involved, and you need to keep asking "is this reasonable?" For example, we've been using E(AB) etc. to mean the energy per formula unit of AB, but what energy? Strictly, it should be the free energy, including zero-point, entropic and temperature contributions. We've assumed large amounts of reagents, and so ignored surface energies and interactions, as well as solvation effects...
This can seem daunting, but in fact you can often gain a lot of insight with a more modest set of calculations, and then expand on them later. Provided you are clear about what you have done, and the assumptions you have made, you can publish your calculations and analyses without having completely exhausted all possibilities.
For example, a while ago I published a paper which included some modelling of a potentially rather complicated growth process (BaFe$_{12}$O$_{19}$ grown on SiC), but in fact we had very good experimental data on which phases were actually forming, and just needed the modelling to help to understand why some phases were favoured in certain growth phases. Even a fairly modest set of simulations was enough to shed some light on it; see
https://aip.scitation.org/doi/pdf/10.1063/1.3559496
where I only really considered the three conditions Ba-rich, Fe-rich and O-rich, and only considered a subset of the possible phases. E.g. for the iron oxide, I only considered Fe$_3$O$_4$, since the main question was why that was forming in the initial growth phase.