P/E is a backward focusing metric, stock price is a forward looking metric. So, unless the company is static they don’t correlate that well.
Look a BMW’s shrinking US / EU sales for the last several years and compare that with Tesla. You don’t want to pay a premium for a sinking ship do you?
PS: The stock market may be irrational, but it’s rarely dumb.