Several factors help to ensure the safety of composted lawn clippings.
Turfgrass pesticides have very short active life spans in which the chemical components are effective against the selected pests. Pesticides don't strongly adhere to grass blades and are typically bound up by chemical reactions in the thatch layer, where they are most effective. Also, the biodegradation that takes place during the composting process eliminates any remaining chemicals that may have been present. In addition to limiting the ability of the herbicide to take effect on the lawn, the clippings could transfer the just sprayed herbicide to the garden where it serves as a mulch. This could cause a plant's growth to be set back slightly, but probably not permanently.