Minimum possible Kinetic Energy of a confined electron
Actually, the derivation you did to get the "correct" answer isn't valid, although it's quite possible that you've never been taught this; even in the world of physics, many people don't know it. What the uncertainty principle tells you is the "spread" in possible values of momentum. If you measure the electron's momentum many times, this uncertainty is the minimum possible standard deviation of the results.
But knowing the uncertainty tells you nothing about the actual minimum value. For that you have to figure out the energy eigenvalues of the system, and then you can pick the lowest one. That is the minimum energy that you can possibly measure the electron to have, and in a case like this where the potential is zero within the region of interest, the same value is the minimum kinetic energy. It will generally be much larger than the spread you would calculate from Heisenberg's uncertainty principle.
So in order to properly do this problem, you will need the Hamiltonian operator so that you can find its eigenvalues. In this case, the Hamiltonian is $H = \frac{p^2}{2m}$ if you restrict the problem to the well, and if you find the eigenvalues of that operator on that region, the lowest one is $\frac{\hbar^2\pi^2}{2ma^2}$ (according to Wikipedia), where $a$ is the width of the region.
The above assumes that you're working in nonrelativistic quantum mechanics, of course; as you've noticed, the energy is much higher than the mass of the electron, and so if you wanted to make a realistic calculation, you would have to use the proper relativistic Hamiltonian. But I'm guessing that is beyond the scope of your class.
The form of your book's value $\frac{\hbar^2}{2ma^2}$ makes it clear that that is a fully classical (non-relativistic) limit ($\frac{p^2}{2m}$, right?), while yours is a fully relativistic one (after all $E,p \gg m_e$).
The argument about the nuclear confinement is simply that both the gravitational and elctromagnetic potentials on the electron due to the nucleus are many orders of magnitude smaller than 40 MeV (the weak nuclear force too, but you may not know how to compute this), and the electron is not affected by the strong nuclear force.