When I was younger I used to wear ankle weights when running. Back then I thought I was gaining muscle strength and would be faster or jump higher when I removed them. Does anyone see a benefit to wearing them when pedaling for training? Or would they do more harm than good?

Think about it. Not only do ankle weights put the wrong dynamics on your legs and joints they train your muscles and nerves to expect that weight when pedaling. Want to build leg, ankle and foot strength? Hit the weight room for specific exercises.

Zero benefit. The weight pushing down equals the weight going up, so there's no effect. I've read one analysis that says you actually LOSE with ankle weights, because the momentum helps carry the pedals over the top.
You might be able to construct a theoretical scenario where you're pedaling clipped in and pulling up hard, so you'd get a little extra workout lifting the weight. But you've still got the opposite weight going down, and many studies have shown that nobody, even top pros, pulls up for more than a few strokes at a time anyway.