A ground from a 4/4/4/6 wire and a local ground, grounding rod, in a detached building does it meet code?
You have the right idea here
Pulling the four-wire feed was definitely the correct move here, as the NEC nowadays requires neutral and grounding/bonding to be provided separately to detached buildings in addition to requiring the structure to provide its own grounding electrode system.  This is because we are dealing with three different functions here:

Neutral works for a living, returning normal power to your main panel and therefore to the utility
The grounding wire provides a safety connection to return any wayward utility power back to the utility -- current flows in loops, after all, and without that grounding wire, any fault to exposed metal will become a shocking experience
The grounding rods, on the other hand, are needed to return wayward natural electricity to terra firma -- this helps deal with voltages induced on the feeder due to lightning strikes, among other things.

And yes, both the incoming grounding wire from the feeder and the grounding electrode conductor from the outbuilding's ground rods get landed on the ground bar in the detached building's panel.  Don't forget that the panel needs to have a main breaker to serve as a disconnect switch for the structure, and also to provide plenty of spaces in that panel for future growth!