Outlet tester shows "bad ground"
If you only have a three wire feed to the barn then the panel should have the neutral and ground connected together.
The old method of wiring a sub-panel in a separate building was the 3-wire method like you have. The wires should be Hot, Hot, Neutral not Hot, Neutral, Ground.
Consequently the sub-panel would have been bonded (neutral and ground connected together). So, the replacement panel should be bonded.
If you have not bonded the neutral to the ground in your barn that is why your tester is saying it has an open ground.
Here is the pertinant NEC section:

(B) Grounded Systems.
(1) Supplied by a Feeder or Branch Circuit. An equipment grounding conductor, as described in 2S0.118, shall be run with the supply conductors and be connected to the building or structure disconnecting means and to the grounding electrode(s). The equipment grounding conduc- tor shall be used for grounding or bonding of equipment, structures, or frames required to be grounded or bonded. The equipment grounding conductor shall be sized in ac- cordance with 2S0.122. Any installed grounded conductor shall not be connected to the equipment grounding conduc- tor or to the grounding electrode(s).
Exception No.1: For installations made in compliance with previous editions of this Code that permitted such connection, the grounded conductor run with the supply to the building or structure shall be permitted to serve as the ground-fault return path if all of the following requirements continue to be met:
(1) An equipment grounding conductor is not run with the supply to the building or structure.
(2) There are no continuous metallic paths bonded to the grounding system in each building or structure involved.
(3) Ground-fault protection of equiprnent has not been in- stalled on the supply side ofthefeeder(s).*

Good luck and stay safe!