Is LP gas trapped between the shutoff valve and the pipe end cap potentially dangerous?
Since you don't say exactly where this is, I used your vague profile location ("NW Washington state") and referred to the code for Seattle.

The proper leak test is to pressurize the pipe to at least 15 psi with a pressure gauge monitoring and verify that there is no visible decrease in pressure reading after 15 minutes.  See section 406.4 of this.

Note that most appliances cannot withstand that kind of pressure, so the testing procedure specifies that individual appliance shut off valves should be set to block flow or be disconnected and the appliance supply line capped.

Typical natural gas residential pressure is 7 inches of water column, which is about 0.25 psi.  So the standard test is a factor of 60 times over the working pressure.


  ... since this was done years ago and the firebox did not blow up, will my charging the line the way I have trap gas between the valve and the cap that is in the firebox?


I think the answer is yes, but I don't think it is the relevant question.  If I understand correctly, you leak tested with gas line pressure only and that is insufficient to reliably detect a leak.

If it were me, I'd be doing a whole gas pipe test by:


Cutting off all the appliances (range, furnace, hot tub, dryer, water heater, etc.) with their individual input line valves.
Operate the cutoff valve at the output side of the gas meter to isolate the system.
Remove a conveniently accessible appliance flex line and attach a pressure gauge assembly.
Pressurize the system (a bicycle tire pump is useful) and observe the steadiness of pressure.
When I have done this, the test gauge itself was a significant source of leakage.  Read about it here.


As for concerns about heating causing a leak, it should be okay if the cap and the pipe are made of the same material so they both expand at the same rate.

It looks like black pipe in your photos.  The melting point of "malleable iron pipe" is 2,570 &deg;F.  The hottest temperature a wood burning fireplace experiences is from the glowing coals after the wood has been consumed at about 1,200 &deg;F.  The pressure rating of the threads at that temperature looks (by extrapolation) to be 10+ psi according to this table.