Graham Potter lost his first game as West Ham boss as Aston Villa staged a second-half recovery to knock the Hammers out of the FA Cup with a 2-1 victory.