Small confusion about the Aharonov-Bohm effect
This "derivation" hits a pet peeve of mine, which is that mathematical treatments of topological phases persistently confuse the phase shift resulting from a physical process with abstract, physically meaningless phases computed by blinding plugging equations into each other.
Physical and Formal Phases
The Aharanov-Bohm effect isn't even the worst example; that award goes to anyons. Anyons pick up a phase $e^{i \phi}$ when their positions are physically exchanged, i.e. when two of them are picked up and swapped by an experimentalist, assuming that there are no extra external fields, the anyons are moved slowly, and so on. However, this is persistently confused with the phase that results from formally swapping two variables in the many-body wavefunction, $$\psi(x_1, x_2, \ldots) = e^{i \theta} \psi(x_2, x_1, \ldots).$$ It is trivial to prove this formal phase is always $\pm 1$ in any dimension, leading even very capable mathematicians to assert that anyons cannot exist. The majority of introductory quantum mechanics books that attempt to treat anyons make precisely this mistake, then mumble something incorrect about topology allowing the formal phase to differ from $\pm 1$. It's a mess. (For a good treatment, see here.)
Similarly, the Aharanov-Bohm phase is the fact that a particle picks up an extra phase $e^{i \theta}$ upon being transported around a flux. It is easy to see where both the Aharanov-Bohm and anyon phase come from if you use the path integral. Mathematically minded students often dismiss this argument, based on trajectories, as "heuristic", but this misses the point, because the physics of the situation is explicitly about trajectories. You can't easily see the phase shift between two trajectories if you use the time-independent Schrodinger equation.
If you don't like the path integral, you can also derive these phases with the adiabatic theorem: trap a particle in a box at location $\mathbf{R}$ and transport the box around the flux. The gauge connection $\mathbf{A}$ functions precisely as the Berry connection on the states $|\mathbf{R} \rangle$, and the derivation then proceeds exactly the same way as the formal fiber bundle derivation below. Note that in both the path integral and adiabatic theorem explicitly require the transport to be slow. In the former case, it's to avoid picking up extra $\int \mathbf{p} \cdot d \mathbf{x}$ phases, and in the latter case it's a condition of the adiabatic theorem.
A Correct Fiber Bundle Derivation
The argument you gave rests on comparing wavefunctions in two different gauges, which is physically meaningless. Here is a correct derivation.
As you know, we may describe the gauge field in terms of a $U(1)$-bundle over $M$. All such bundles are trivial, which is why most courses don't talk about them; it just makes things more complicated. However, suppose we chose to use bundles anyway and covered $M$ with two patches. Then we may compute the phase picked up by transporting a particle around the flux as follows.
- Within the first patch, integrate $\int \mathbf{A} \cdot d\mathbf{x}$.
- When the particle passes from the first patch to the second, add a phase to account for the transition function between the patches.
- Within the second patch, integrate $\int \mathbf{A} \cdot d \mathbf{x}$.
- When the particle passes from the second patch back to the first, add another transition function phase.
Since the bundle is trivial, the transition functions can be chosen to be trivial, reducing to the non-bundle formalism. However, we could also choose to gauge away the connection within each patch. Then the particle picks up no phase at all as it is parallel transported through the patches (again, assuming it is moving slowly, with no extra external fields, ignoring dynamical phases, etc.) but does pick up phases from nontrivial transition functions. Of course, since the answer is a physical quantity, it will be the same calculated either way. Your text just showed this explicitly.
Using the Fake Derivation
The comparison of wavefunctions in two different gauges has nothing to do with the physical process in the Aharanov-Bohm effect, but your text gets the right answer basically by accident; there's only one answer you could possibly get in this simple situation. Luckily, your text's setup is useful for a different thing: finding the spectrum of particles on a ring.
Suppose a particle is constrained to a ring, through which a flux passes. If there were no flux, the energy eigenstates would be $$\psi_n(\theta) \propto e^{i n \theta}, \quad E_n \propto n^2.$$ Now suppose the flux is turned on, giving an Aharanov-Bohm phase $e^{i \phi}$. Usually, to get the spectrum you have to solve the Schrodinger equation with a vector potential, but using the fiber bundle setup we can just set it to zero on each patch. Supposing we set one of the transition functions to be trivial too, and letting the other patch intersection be at $\theta = 0$, we have $$\lim_{\theta \to 0^+} \psi_n(\theta) = e^{i \phi} \lim_{\theta \to 2\pi^-} \psi_n(\theta)$$ where $\psi_n(\theta)$ satisfies the Schrodinger equation for zero vector potential. (Of course the wavefunction remains single-valued, as long as we remember it only makes sense to compare it to itself within one patch.) Then we have $$\psi_n(\theta) \propto e^{i (n - \phi/2\pi) \theta}, \quad E_n \propto (n - \phi/ 2 \pi)^2$$ which gives a measurable change in the spectrum. This is a case where you do want the time-independent Schrodinger equation, not path integral trajectories, but that is because the physics is completely different.