Testing Immunotherapy (Atezolizumab) With or Without Chemotherapy in Locoregional MSI-H/dMMR Gastric and Gastroesophageal Junction (GEJ) Cancer

This phase II trial compares atezolizumab in combination with chemotherapy (docetaxel, oxaliplatin, leucovorin calcium, fluorouracil, capecitabine) to atezolizumab alone for controlling the growth and/or spreading of the disease in patients with gastric or gastroesophageal junction (JEG) cancer that has not spread from where it first started (local) or only has spread to nearby lymph nodes or tissue (locoregional) and has high microsatellite instability (MSI-H) and mismatch repair deficiency (dMMR). The mismatch repair (MMR) system in the body corrects errors made during the copying of DNA and serves as a proofreading function. If this system isn't working correctly, mutations (changes) in DNA occur which can allow the cancer to grow or spread. This is called dMMR (deficient mismatch repair) . MSI-H describes cancer cells that have a high number of mutations within microsatellites. For example, microsatellite testing that shows mutations in 30% or more microsatellites is called microsatellite instability-high (MSI-H). Microsatellites are short, repeated sequences of DNA. There is evidence that MSI-H/ dMMR gastric or GEJ tumors respond well to immunotherapy. Immunotherapy with monoclonal antibodies, such as atezolizumab, may help the body's immune system attack the cancer, and may interfere with the ability of tumor cells to grow and spread. Docetaxel is in a class of medications called taxanes. It stops tumor cells from growing and dividing and may kill them. Oxaliplatin is in a class of medications called platinum-containing antineoplastic agents. It damages the cell's DNA and may kill tumor cells. Capecitabine is in a class of medications called antimetabolites. It is taken up by tumor cells and breaks down into fluorouracil, a substance that kills tumor cells. Chemotherapy drugs such as leucovorin calcium and fluorouracil work in different ways to stop the growth of tumor cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Using atezolizumab as immunotherapy with and following chemotherapy versus atezolizumab alone prior to and after surgery may shrink or stabilize the tumor in patients with MSI-H/dMMR localized gastric or GEJ cancer and may increase the length of time after treatment that cancer does not come back or get worse.

PRIMARY OBJECTIVE:

I. To compare three-year event-free survival (EFS) following the administration of perioperative atezolizumab and chemotherapy versus atezolizumab alone in patients with resectable microsatellite instability-high (MSI-H)/mismatch repair deficiency (dMMR) gastric and gastroesophageal junction (GEJ) cancer.

SECONDARY OBJECTIVES:

I. To assess tumor regression grade (TRG) rates following the administration of perioperative atezolizumab and chemotherapy versus atezolizumab in patients with resectable MSI-H/dMMR gastric and gastroesophageal junction (GEJ) cancer.

II. To assess overall survival (OS) following the administration of perioperative atezolizumab and chemotherapy versus atezolizumab in patients with resectable MSI-H/dMMR gastric and gastroesophageal junction (GEJ) cancer.

III. To assess the toxicity associated with the administration of perioperative atezolizumab and chemotherapy versus atezolizumab in patients with resectable MSI-H/dMMR gastric and gastroesophageal junction (GEJ) cancer.

IV. To correlate circulating tumor-derived deoxyribonucleic acid (ctDNA) clearance (defined as \> 50% reduction or a reduction to undetectable levels) with TRG, EFS and OS.

OUTLINE: Patients are randomized to 1 of 2 arms.

ARM A:

NEOADJUVANT THERAPY: Patients receive physician's choice of chemotherapy regimen consisting of 4 cycles of docetaxel intravenously (IV), oxaliplatin IV, leucovorin calcium IV, and fluorouracil IV (FLOT) or 4 cycles of oxaliplatin IV, leucovorin calcium IV, and fluorouracil IV (mFOLFOX) or 3 cycles of oxaliplatin IV and capecitabine orally (PO) (CAPOX) in addition to atezolizumab IV on study.

SURGERY: Patients undergo surgery with lymphadenectomy on study.

ADJUVANT THERAPY: Patients receive FLOT, mFOLFOX, or CAPOX and atezolizumab IV as in Neoadjuvant Therapy and then receive atezolizumab IV alone.

ARM B:

NEOADJUVANT THERAPY: Patients receive 3 cycles of atezolizumab IV on study.

SURGERY: Patients undergo surgery with lymphadenectomy on study.

ADJUVANT THERAPY: Patients receive 9 cycles of atezolizumab IV on study.

All patients also undergo computed tomography (CT) or magnetic resonance imaging (MRI) throughout the trial. Patients may optionally undergo positron emission tomography (PET)/CT and/or collection of blood samples throughout the trial. Patients may also undergo echocardiography (ECHO) throughout the trial as clinically indicated.

Patients are followed up for 10 years from the date of randomization.

Eligibility Criteria:
Inclusion Criteria:

* Patient must be \>= 18 years of age
* Patient must have histologically or cytologically confirmed diagnosis of gastric or gastroesophageal junction adenocarcinoma that is MSI-H/dMMR (microsatellite instability-high/mismatch repair deficient) as determined by one of three methods:

  * Deficient deoxyribonucleic acid (DNA) mismatch repair protein (MMR) expression status: MMR status must be assessed by immunohistochemistry (IHC) for MMR protein expression (MLH1, MSH2, MSH6, PMS2) where loss of one or more proteins indicates dMMR. dMMR may be determined either locally or by site-selected reference lab by Clinical Laboratory Improvement Act (CLIA)-certified assay

    * NOTE: Loss of MLH1 and PMS2 commonly occur together
  * Polymerase chain reaction (PCR) determined microsatellite instability
  * MSI-H tumor status determined by next-generation sequencing
* Patient must have previously untreated localized gastric, or Siewert type II or III GEJ (gastroesophageal junction) adenocarcinoma. Tumors must be staged as T2 or greater primary lesion or be any T stage with the presence of positive locoregional lymph nodes- N+ (clinical nodes) without evidence of metastatic disease

  * Siewert type II tumors: tumors located between 1 cm proximal and 2 cm distal to the GEJ
  * Siewert type III tumors: tumors located between 2 and 5 cm distal to GEJ
* Patient must be amenable to surgical resection with therapeutic intent
* Patient must have an Eastern Cooperative Oncology Group (ECOG) performance status 0-2
* Absolute neutrophil count (ANC) \>= 1,500/mcL (obtained =\< 14 days prior to randomization)
* Platelets \>= 100,000/mcL (obtained =\< 14 days prior to randomization)
* Hemoglobin \>= 9 g/dL (obtained =\< 14 days prior to randomization)
* Total bilirubin =\< 1.5 x institutional upper limit of normal (ULN) OR direct bilirubin =\< ULN (for patients with total bilirubin \> 1.5 x ULN) (obtained =\< 14 days prior to randomization)
* Aspartate aminotransferase (AST) (serum glutamic-oxaloacetic transaminase \[SGOT\])/alanine aminotransferase (ALT) (serum glutamate pyruvate transaminase \[SGPT\]): x =\< 3 institutional ULN (obtained =\< 14 days prior to randomization)
* Creatinine =\< 1.5 x institutional ULN OR glomerular filtration rate (GFR) \> 50 mL/min/1.73m\^2 (obtained =\< 14 days prior to randomization)
* Albumin \>= 2.5 g/dL (obtained =\< 14 days prior to randomization)
* International normalized ratio (INR) OR prothrombin time (PT) =\< 1.5 x ULN (unless patient is receiving anticoagulant therapy as long as PT or partial thromboplastin time \[PTT\] is within therapeutic range of intended use of anticoagulants) (obtained =\< 14 days prior to randomization)
* Activated partial thromboplastin time (aPTT) =\< 1.5 x ULN (unless patient is receiving anticoagulant therapy as long as PT or PTT is within therapeutic range of intended use of anticoagulants) (obtained =\< 14 days prior to randomization)
* Human immunodeficiency virus (HIV)-infected patients on effective anti-retroviral therapy with undetectable viral load within 6 months are eligible for this trial
* Patient must have no contraindications to receive one of the chemotherapy regimens: FLOT or mFOLFOX / CAPOX
* Patient must not have had prior potentially curative surgery for carcinoma of the stomach/GEJ
* Patient must not receive any other standard anti-cancer therapy or experimental agent concurrently with the study drugs
* Patient must have recovered from clinically significant adverse events of their most recent therapy/intervention prior to randomization
* Patients with known history or current symptoms of cardiac disease, or history of treatment with cardiotoxic agents, should have a clinical risk assessment of cardiac function using the New York Heart Association Functional Classification. To be eligible for this trial, patients should be class 2B or better
* Patients with a prior or concurrent malignancy whose natural history or treatment does not have the potential to interfere with the safety or efficacy assessment of the investigational regimen are eligible for this trial
* Patient must have chest/abdomen/pelvis CT completed within 4 weeks prior to randomization
* Patient may not have received prior treatment with an immune checkpoint inhibitor (anti-PD-1, anti-PDL-1, anti-PDL-2, anti-CTLA4 monoclonal antibody)
* Patient must not have received any live vaccines within 30 days prior to randomization and while participating in the study. Live vaccines include, but are not limited to, the following: measles, mumps, rubella, chicken pox, yellow fever, rabies, Bacillus Calmette-Guerin (BCG), and typhoid (oral) vaccine. Patients are permitted to receive inactivated vaccines and any non-live vaccines including those for the seasonal influenza and coronavirus disease 2019 (COVID-19) (Note: intranasal influenza vaccines, such as Flu-Mist \[registered trademark\] are live attenuated vaccines and are not allowed). If possible, it is recommended to separate study drug administration from vaccine administration by about a week (primarily, in order to minimize an overlap of adverse events)
* Patient must not have active autoimmune disease or history of autoimmune disease that might recur, which may affect vital organ function or require immune suppressive treatment including systemic corticosteroids. These include but are not limited to patients with a history of immune related neurologic disease, multiple sclerosis, autoimmune (demyelinating) neuropathy, Guillain- Barre syndrome, myasthenia gravis; systemic autoimmune disease such as systemic lupus erythematosus (SLE), connective tissue disease, scleroderma, inflammatory bowel disease (IBD), Crohn's, ulcerative colitis and hepatitis. Patients with a history of toxic epidermal necrolysis (TEN), Stevens-Johnson syndrome, or phospholipid syndrome are ineligible because of the risk of recurrence or exacerbation of disease. Patients with vitiligo, endocrine deficiencies including thyroiditis managed with replacement hormones including physiologic corticosteroids are eligible. Patients with rheumatoid arthritis and other arthropathies, Sjogren's syndrome and psoriasis controlled with topical medication and patients with positive serology, such as antinuclear antibodies (ANA), anti-thyroid antibodies should be evaluated for the presence of target organ involvement and potential need for systemic treatment but otherwise are eligible.

  * Patients are permitted to enroll if they have vitiligo, type I diabetes mellitus, residual hypothyroidism due to autoimmune condition only requiring hormone replacement, psoriasis not requiring systemic treatment, or conditions not expected to recur in the absence of an external trigger (precipitating event)
* Patients must not be receiving systemic steroid therapy equivalent to \> 10 mg prednisone per day or any other form of immunosuppressive therapy within 7 days prior to randomization. Topical corticosteroid or occasional inhaled corticosteroids are allowed
* Patient must not have known interstitial lung disease that is symptomatic or may interfere with the detection or management of suspected drug-related pulmonary toxicity, and must not have a known history of prior pneumonitis requiring treatment with steroids, or any evidence of active, non-infectious pneumonitis
* Patient must not have a known history of active TB (Bacillus Tuberculosis)
* Patient must not have any hypersensitivity to atezolizumab or any of its excipients
* Patient must not have received any prior chemotherapy, targeted small molecule therapy, or radiation therapy for their MSI-H/dMMR gastric and GEJ cancer
* Patient must not have had an allogeneic bone marrow/stem, cell or solid organ transplant
* Patient must not have a history or current evidence of any condition (e.g., known deficiency of the enzyme dihydropyrimidine dehydrogenase \[DPD\]), therapy, or laboratory abnormality that might confound the results of the trial, interfere with the patient's participation for the full duration of the trial, or is not in the best interest of the patient to participate, in the opinion of the treating investigator
* Patient must not have any condition that would interfere with the cooperation with the requirements of this trial
* Patient must not be pregnant or breast-feeding due to the potential harm to an unborn fetus and possible risk for adverse events in nursing infants with the treatment regimens being used

  * All patients of childbearing potential must have a blood test or urine study within 14 days prior to randomization to rule out pregnancy
  * A patient of childbearing potential is defined as anyone, regardless of sexual orientation or whether they have undergone tubal ligation, who meets the following criteria: 1) has achieved menarche at some point, 2) has not undergone a hysterectomy or bilateral oophorectomy; or 3) has not been naturally postmenopausal (amenorrhea following cancer therapy does not rule out childbearing potential) for at least 24 consecutive months (i.e., has had menses at any time in the preceding 24 consecutive months)
* Patient must not expect to conceive or father children by using accepted and effective method(s) of contraception or by abstaining from sexual intercourse while on protocol treatment. Patients of childbearing potential must continue contraception measures for 5 months after the last dose of atezolizumab and for 9 months after the last dose of chemotherapy. Male patients with partners of childbearing potential must continue contraception measures for 6 months after the last dose of chemotherapy. Patients of childbearing potential must also not breastfeed while on treatment and for 5 months after the last dose of atezolizumab and for 3 months after the last dose of chemotherapy
* Patient must have the ability to understand and the willingness to sign a written informed consent document. Patients with impaired decision-making capacity (IDMC) who have a legally authorized representative (LAR) or caregiver and/or family member available will also be considered eligible
* For patients with evidence of chronic hepatitis B virus (HBV) infection, the HBV viral load must be undetectable on suppressive therapy, if indicated
* Patients with a history of hepatitis C virus (HCV) infection must have been treated and cured. For patients with HCV infection who are currently on treatment, they are eligible if they have an undetectable HCV viral load
* The investigator must declare the chemotherapy regimen their patient will receive (FLOT or mFOLFOX / CAPOX) prior to randomization