Is this okay?

I’ve never seen this before, and I’m not sure if it meets code or not.

Main service on a residential building feeds panel in second building (with main breaker) about 40 feet away. Three insulated conductors for 240 volts, two ungrounded and one grounded neutral. So far everything is normal, but the equipment ground is bare solid copper, connects to two ground rods and then continues to the main building, all unspliced, as far as I can tell. So it serves as the grounding electrode conductor and the equipment ground at the same time. No main bonding jumper at the second building, and all conductors in bare earth and run together. Probably worth it to note that this was built about ten years ago, maybe a little more. I really can’t find anywhere where this is a violation, but it looks strange.
I’m having a hard time fully grasping what you’re trying to describe. Are there ground rods at the main building also? Is the bare conductor at the second building connected to the panel enclosure (in the second building)?

Some of the answers to compliance may depend on the year it was installed (and what was adopted at that time).
There are ground rods at the main building on a separate grounding electrode conductor. This line from the second building runs out of the panel, connects with two rods and continues to the main building service. My guess is that the second building was built about 2005 to 2010.
With them combining EGC and GEC for a portion of the circuit, is that what you are questioning? The exception in 250.121 could allow this if they are meeting the requirements listed.
Yes that's it. For some reason I never caught that exception. This installation was a bit ahead of it's time I guess, and I have never seen this done before. Thanks for pointing that out.