a) Facebook is not doomed for failure. Their audience just got older and rather than abandon them they acquired companies more suited to younger generations e.g. Instagram, Oculus instead. And it's a strategy that has unquestionably worked.
b) Facebook isn't really pivoting to metaverse any more than Apple is pivoting to services. It's an additional revenue stream alongside their existing ones which are still very healthy and lucrative.