It is certainly not the correct way to do it, you created the infamous ground loop. The hot, neutral and ground should be terminated at the breaker box only.
all good, I've been a electrician once upon a time and had to dig into generations of electrical work.
What you connected was OK a few decades ago. But these days with cheaper wires the Code usually specifies going directly from the panel to the outlet without any junctions. Since especially in an RV any connection could rattle lose over time. So you want to reduce your chances of error.