They are seeds.
Your weed probably got pollinated somehow in the last couple weeks of flowering.
Because it happened so late in the plant's life, the seeds started forming, but did not develop fully.