I think I solved it.
I removed the cable and found that the RD moves crisply when pushed with my hand.
I saturated the brifter with WD-40.
I went for a ride, and it was still happening. Then, while riding, I adjusted the tension with the adjuster on the downtube. I don't know if all bikes have this, but I can flick this little lever to one of about five different positions.
For the rest of the ride, every single shift worked perfectly.
So, my conclusion was that I hadn't adjusted things properly, and the RD wasn't lined up just right, so it was somewhat between cogs.