In addition to command & control, the IL-22 probably has an ELINT capability and perhaps could detect a Patriot launch.
My guess is that ruzzia was planning a large offensive across the entire front and both aircraft would provide support to ruzzian fighter aircraft and helicopters that were needed for Close Air Support (CAS).
Ukraine just confirmed the IL-22 shootdown.