In the years before the COVID-19 pandemic swept through the nation’s long-term care facilities and overwhelmed healthcare workers, Maine nursing homes increasingly hired nurses and nursing assistants through outside agencies to prevent staffing shortages.