TBF Blackbeard was in Whitebeard's crew and fought about Roger's crew a lot back then, and Rayleigh was one of the top fighters in that crew, so it makes sense that he had a deep fear of Rayleigh to the point where he didn't even think rationally about whether Rayleigh was still as strong as he was back then. Aramaki running from Shanks isn't stupid because he's a coward- Even Sengoku was sure that Akainu ( along with the other Admirals present at the war ), who has way more offensive power than Aramaki, couldn't take on Shanks, and thus just told him to yield and stop the war. It's stupid because he came to Wano to take on Luffy, someone with arguably way more feats than Shanks seeing as he defeated Kaidou, trolled Big Mom and came out of her territory with only one of his friends dying ( ngl Pedro wasn't important though ), infiltrated Vegapunk's lab, etc. But when Shanks came suddenly he can't fight a Yonko and their crew?