Amazon ramped up hiring to handle soaring online shopping demand during the pandemic only to find itself overstaffed as inflation tightens consumer budgets.