I am trying to figure out what happens when a parcel of air rises in the atmosphere, and obtains potential energy due to its increased elevation loses kinetic energy proportional to the potential energy gained.

This looks like a planetary/stellar atmospheres problem to me. For stellar atmospheres, add a radiation component to the gas pressure (radiation pressure).

It is often easier to solve atmosphere problems in terms of force balance rather than energetics. For example, by considering gas pressure versus gravity, it's possible to derive the hydrostatic equilibrium equation. Then, from there, you can also derive the virial theorem. This is true regardless of whether there is convection or not.

Then while at TOA cools in accordance with radiation laws, then drops in the convection loops back to the surface where potential energy is converted back to kinetic energy in proportion to the lower temperature.

In the process it seems more energy would have been lost than has been accounted for by the TOA radiation. It seems I am missing something in view of the gas pressure laws and the conservation of energy. Any help would be greatly appreciated so I can understand this process.

Remember that mass packets are not isolated... they are constantly interacting with their environment, so their energetics are not the same as ballistic problems in mechanics. They will either gain or lose energy based on the temperature difference of the mass packet with the surroundings and can be pushed up or sink down based on pressure gradients in the atmosphere.

I think you'll reach a satisfactory understanding if you not only consider kinetic and potential energy, but also heat energy exchange with the surroundings.

In convection, the mass packet accelerates because the gains into the mass packet from the environment (i.e. because of the temperature gradient) exceed the losses, causing the packet to gain more internal energy, expand further, increase the pressure difference and consequently increase the buoyancy force. Only when the mass packet reaches a region where the pressure gradients no longer favour energy gain will the mass packet start to lose momentum as it ploughs into a stable region of the atmosphere, causing boundary mixing.

To determine where convection happens, you need to consider pressure gradients for gas + radiation pressure versus total pressure as a function of height. Then consider a criterion, such as the Schwarzschild or Ledoux criterion, to determine whether convection is happening.