ServiceNow has laid off hundreds of employees in a global restructuring as it shifts toward AI, despite strong earnings and plans to keep headcount steady.