Rack and fender on one eyelet spacing issue
A longer bolt is indeed a risk because of the extra leverage. The second photo suggests that even a tiny bend back away from the rack will solve your problem - you only need 5mm or so.

If you're willing to bend the fender stay that is a much better solution. The simple, crude way is just to bend it on the bike. Simply hold the fender in place with one hand and push the stay in towards the wheel with the other. You'll probably need to move the fender out using the stay adjustment system to get it to sit straight on the wheel. Unless you need a really big gap (more than 10mm) this should work. You'll have a curved stay and it will look very DIY.

The more organised way that lets you deal with a fender with no adjustment is to pull the stay off the bike and bend it in specific places using a vice. That will let you put a matching set of bends on the other side of the bike so that the fender sits straight. You still need extra length available because the bends pull the fender in towards the wheel.

If you don't have the extra length available you will have to fall back to using a longer bolt. Try to keep the extra length to a minimum. I suggest using a button head bolt rather than a square head because that bolt head will wear a hole in your pannier.