Car sometimes won't start on 1st try in warm weather

I have a 1995 Subaru Legacy manual 5-speed with 125,000 miles. The starting system has a “starter interlock relay” under the dash and safety switch on the clutch (won’t start if not engaged). This switch was replaced about a year ago because if the clutch wasn’t all the way to the floor with a fair amount of force, it wouldn’t start. Now it’s back to normal, but there’s another starting problem.

Lately, it won’t start on the first try if it’s been parked outside for about five hours or more in warm weather. Always starts good in the morning. I think I hear the rapid clicking of relay under the dash when it doesn’t start, rather than the starter’s solenoid under the hood. On rare occasion, there’s no sound the first time, clicking on the second try, and the third time it starts immediately.

So, whatever is wrong, is overcome by cranking the starter a second or third time. Since it only happens when it’s warm outside, obviously it’s not solved by something being “warmed up” on the first or second try.

Could it be a fuel pump problem? Not enough gas the first time? Or, maybe a bad relay that gets unstuck after a while? No related parts have ever been replaced besides the clutch switch (1 yr), alternator (1 yr), and battery (3 yrs).