Olaparib and Ramucirumab in Treating Patients With Metastatic or Locally Recurrent Gastric or Gastroesophageal Junction Cancer That Cannot Be Removed by Surgery

This phase I/II trial studies the side effects and best dose of olaparib when given together with ramucirumab and how well they work in treating patients with gastric or gastroesophageal junction cancer that has spread to other places in the body (metastatic), has come back (recurrent), or cannot be removed by surgery (unresectable). Olaparib may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. Immunotherapy with monoclonal antibodies, such as ramucirumab, may help the body's immune system attack the cancer, and may interfere with the ability of tumor cells to grow and spread. Giving olaparib and ramucirumab may work better in treating patients with gastric or gastroesophageal junction cancer compared to ramucirumab and paclitaxel (a chemotherapy drug) or ramucirumab alone.

PRIMARY OBJECTIVES:

I. To determine the safe dose of olaparib with ramucirumab, but not to exceed olaparib dose of 300 mg twice daily (tablet formulation). (Phase I) II. To determine the efficacy of olaparib plus ramucirumab as measured by the objective response rates (ORR) stratified by BROCA-HR biomarker status. (Phase II).

SECONDARY OBJECTIVES:

I. To estimate median progression-free survival (PFS) stratified by BROCA-HR biomarker status.

II. To estimate median overall survival (OS) stratified by BROCA-HR biomarker status.

III. To measure the prevalence of the BROCA-HR biomarker in our study population.

IV. To determine toxicity of olaparib and ramucirumab combination.

EXPLORATORY OBJECTIVES:

I. To assess the correlation between the signature 3 status, and mutations in BROCA-HR panel.

II. To evaluate the association between findings from BROCA-HR panel with response to therapy.

III. To evaluate the association between findings from BROCA-HR panel and signature 3 results with response to therapy.

IV. To determine results of immunoassay for poly-ADP-ribosylated (PAR) substrates in tumor tissue.

V. To create a PDX model to study deoxyribonucleic acid (DNA) repair in gastric tumors treated with PARP inhibitors (PARPi) from both pre-treatment biopsy and repeat biopsy after 16 weeks of treatment.

VI. Development of a novel genomic assay for BRCAness. VII. Defining T cell receptor diversity of gastric cancer patients +/- BRCAness.

VIII. Biobank additional tumor tissue for future genomic analysis. IX. Biobank peripheral blood for future genomic analysis and assessment of circulating tumor DNA.

OUTLINE: This is a phase I, dose-escalation study of olaparib followed by a phase II study.

Patients receive olaparib orally (PO) twice daily (BID) on days 1-14 of each cycle and ramucirumab intravenously (IV) over 60 minutes on day 1 of each cycle. Cycles repeat every 14 days in the absence of disease progression or unacceptable toxicity.

After completion of study treatment, patients are followed up at 4 weeks and then every 6 weeks if the patient has not had disease progression and every 3 months if the patient has had disease progression.

Eligibility Criteria:
Inclusion Criteria:

* The patient must have histologically confirmed, gastric carcinoma, including gastroesophageal junction (GEJ) adenocarcinoma (patients with adenocarcinoma of the distal esophagus are eligible if the primary tumor involves the GEJ)
* The patient has metastatic disease or locally recurrent, unresectable disease
* The patient must have measurable disease by Response Evaluation Criteria in Solid Tumors (RECIST) version (v)1.1
* The patient must have experienced disease progression during or within 4 months after the last dose of chemotherapy for metastatic disease, during or within 6 months after the last dose of adjuvant chemotherapy, or have been intolerant of previous chemotherapy
* The patient must have experienced disease progression or intolerance as outlined above after treatment with 1 or more prior chemotherapies
* All previous treatments are acceptable as long as they did not contain bevacizumab, ramucirumab or PARP inhibitors
* Elevation in tumor markers without radiographic evidence of disease progression is not satisfactory for progression on previous treatment
* The patient is \>= 18 years of age
* The patient has a life expectancy of \>= 16 weeks
* Eastern Cooperative Oncology Group (ECOG) performance status score of 0-1 (Karnofsky \>= 60%)
* Hemoglobin \>= 10 g/dL with no blood transfusions (packed red blood cells and platelet transfusions) in the past 28 days (within 28 days prior to administration of study treatment)
* White blood cells (WBC) \> 3 x 10\^9/L (within 28 days prior to administration of study treatment)
* Absolute neutrophil count (ANC) \>= 1.5 10\^9/L (within 28 days prior to administration of study treatment)
* Platelet count \>= 100 X 10\^9/L (within 28 days prior to administration of study treatment)
* No features suggestive of myelodysplastic syndrome (MDS)/acute myelogenous leukemia (AML) on peripheral blood smear or bone marrow biopsy, if clinically indicated (within 28 days prior to administration of study treatment)
* Total bilirubin =\< 1.5 x the institutional upper limit of normal (ULN) (within 28 days prior to administration of study treatment)
* Aspartate aminotransferases (AST) (serum glutamic-oxaloacetic transaminase \[SGOT\])/alanine aminotransferase (ALT) (serum glutamate pyruvate transaminase \[SGPT\]) =\< 2.5 x institutional ULN unless liver metastases are present in which case they must be =\< 5 x ULN (within 28 days prior to administration of study treatment)
* Calculated serum creatinine clearance \>= 60 mL/min/1.73 m\^2 (within 28 days prior to administration of study treatment)
* Proteinuria with urinary protein =\< 1+ on dipstick or routine urinalysis, or a 24-hour urine collection for protein \< 1000 mg of protein in 24 hours (within 28 days prior to administration of study treatment)
* Coagulation parameters (international normalized ratio \[INR\], activated partial thromboplastin time \[aPTT\]) =\< 1.25 x institutional limits, except where a lupus anti-coagulant has been confirmed or the patient is on warfarin; patients on full dose anticoagulation must be on a stable dose for at least 14 days; if receiving warfarin, the patient must have an INR =\< 3.0 without any evidence of active bleeding within 14 days prior to first dose of study treatment or a pathologic condition that carries a high risk of bleeding (tumor involvement with major blood vessels or varices) (within 28 days prior to administration of study treatment)
* Postmenopausal or evidence of non-childbearing status for women of childbearing potential a negative urine or serum pregnancy test within 28 days of study treatment and confirmed prior to treatment on day 1; postmenopausal is defined as:

  * Amenorrheic for 1 year or more following cessation of exogenous hormonal treatments
  * Luteinizing hormone (LH) and follicle stimulating hormone (FSH) levels in the postmenopausal range for women under 50
  * Radiation-induced oophorectomy with last menses \> 1 year ago
  * Chemotherapy-induced menopause with \> 1 year interval since last menses
  * Surgical sterilization (bilateral oophorectomy or hysterectomy)
* The effects of olaparib and ramucirumab on the developing fetus are unknown; for this reason, women of child-bearing potential and men must agree to use adequate contraception including hormonal, barrier, or abstinence; contraception must be started prior to study enrollment; female patients of childbearing potential must have a negative serum pregnancy test within 7 days prior to treatment; should a woman become pregnant or suspect she is pregnant while she or her partner is participating in this study, she should inform her treating physician immediately; both men and women treated or enrolled on this protocol must also agree to use adequate contraception prior to the study, for the duration of the study participation, and for 3 months after completion of olaparib and ramucirumab administration; male patients and their partners, who are sexually active and of childbearing potential, must agree to the use of two highly effective forms of contraception in combination, throughout the period of taking study treatment and for 3 months after last dose of study drug(s) to prevent pregnancy in a partner
* Ability to understand and the willingness to sign a written informed consent document
* The patient must be willing to undergo a biopsy prior to treatment, an on treatment biopsy at week 16 is optional if felt to be safe in the opinion of the investigator
* For inclusion into optional exploratory genetic and biomarker research, patients must fulfill the following criteria:

  * Provision of informed consent for genetic research
  * Provision of informed consent for biomarker research

    * If a patient declines to participate in the optional exploratory genetic research or the optional biomarker research, there will be no penalty or loss of benefit to the patient; the patient will not be excluded from other parts of the study
* Patients must be able to tolerate oral medications by mouth, and not have a gastrointestinal illness that would preclude absorption of olaparib
* Adequately controlled blood pressure (BP) \< 140 mmHg (systolic) and \< 90 mmHg (diastolic) taken in the clinic setting by a medical professional within 2 weeks prior to starting study; patients with hypertension may be managed with up to a maximum of 3 antihypertensive medications; a cardiologist or blood pressure specialist must evaluate patients who are on 3 antihypertensive medications within 4 weeks of enrollment
* Patients who have the following risk factors are considered to be at increased risk for cardiac toxicity and must have documented left ventricular ejection fraction (LVEF) by echocardiogram greater than institution's lower limit of normal (or 55% if threshold for normal not otherwise specified by institutional guidelines) obtained within 3 months

  * Prior treatment with anthracyclines
  * Prior treatment with trastuzumab
  * A New York Heart Association (NYHA) classification of II controlled with treatment
  * Prior central thoracic radiation therapy (RT), including RT to the heart
  * History of myocardial infarction within 12 months (patients with history of myocardial infarction within 6 months are excluded)

Exclusion Criteria:

* Patients with untreated brain metastases are excluded from this clinical trial because of their poor prognosis and because they often develop progressive neurologic dysfunction that would confound the evaluation of neurologic and other adverse events; a scan to confirm the absence of brain metastases is not required; the patient can receive a stable dose of corticosteroids before and during the study as long as these were started at least 4 weeks prior to treatment; patients with spinal cord compression are also excluded unless considered to have received definitive treatment for this and evidence of clinically stable disease for 28 days
* Patients who have not recovered from adverse events due to prior anti-cancer therapy (i.e., have residual toxicities \> Common Terminology Criteria for Adverse Events \[CTCAE\] grade 1 or baseline, with the exception of alopecia)
* Patients unable to swallow orally administered medication and patients with gastrointestinal disorders likely to interfere with absorption of the study medication
* The patient has experienced any grade 3-4 gastrointestinal bleeding within 3 months prior to randomization
* The patient has experienced any arterial thrombotic events, including but not limited to myocardial infarction, transient ischemic attack, cerebrovascular accident, or unstable angina, within 6 months prior to enrollment
* The patient has an ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, symptomatic or poorly controlled cardiac arrhythmia, uncontrolled thrombotic or hemorrhagic disorder, or any other serious uncontrolled medical disorder in the opinion of the investigator
* The patient has an ongoing or active psychiatric illness or social situation that would limit compliance with study requirements
* Clinically significant peripheral vascular disease or vascular disease (abdominal aortic aneurysm \> 5 cm) or aortic dissection; if known history of abdominal aortic aneurysm with \>= 4 cm in diameter, all of the following must be met

  * An ultrasound within the last 6 months required to document that it is =\< 5 cm
  * Patient must be asymptomatic from the aneurysm
  * Blood pressure must be well controlled as defined in this protocol
* The patient has uncontrolled or poorly controlled hypertension despite standard medical management as defined in this protocol
* NYHA classification of III or IV
* A resting electrocardiogram (EKG) with a corrected QT (QTC) \>= 470 msec detected on 2 or more time points within a 2 hour period or family history of long QT syndrome; if the EKG demonstrates QTC \>= 470 msec, the patient will only be eligible if a repeat EKG demonstrates QTC =\< 470 msec
* History of hypertensive crisis or hypertensive encephalopathy within 3 years
* Major surgery within 28 days of starting study treatment and patients must have recovered from any effects of any major surgery
* An open biopsy, non-healing wound, ulcer or significant traumatic injury within 28 days prior to starting treatment (percutaneous, endobronchial, and endoscopic biopsies are allowed)
* The patient has received chemotherapy, radiotherapy (except for palliative reasons), immunotherapy, or targeted therapy for gastric cancer within 3 weeks of study treatment
* The patient has received any investigational therapy within 4 weeks of enrollment
* The patient has received prior therapy with bevacizumab, ramucirumab or any PARP inhibitor, including olaparib
* Patients must not have evidence of coagulopathy or bleeding diathesis; therapeutic anticoagulation for prior thromboembolic events is permitted; the clinical indication for therapeutic anticoagulation must be clearly documented prior to enrollment and must be discussed with the principal investigator (PI); due to risk of serious bleeding with ramucirumab, patients on greater than or equal to 2 anti-thrombotic agents, including but not limited to anti-platelet agents (nonsteroidal anti-inflammatory drugs \[NSAIDS\]/aspirin, clopidogrel), heparin, low molecular weight heparin, warfarin and a direct thrombin inhibitor will be excluded
* The patient has elective or planned major surgery to be performed during the course of the clinical trial
* History of allergic reactions attributed to compounds of similar chemical or biologic composition to olaparib and ramucirumab
* Patients with a known hypersensitivity to olaparib or any of the excipients of the product
* Patients with a known hypersensitivity to the combination/comparator agent
* Pregnant or breast feeding women are excluded from this study because olaparib and ramucirumab have the potential for teratogenic or abortifacient effects
* Immunocompromised patients, this includes human immunodeficiency virus (HIV)-positive patients, because of the potential for interaction with antiretroviral therapy and ramucirumab and/or olaparib; in addition, these patients are at increased risk of lethal infections when treated with marrow-suppressive therapy
* Patients with a known history of hepatitis B (defined as hepatitis B surface antigen \[HBsAg\] reactive) or known active hepatitis C virus (defined as detectable hepatitis C virus \[HCV\] ribonucleic acid \[RNA\]) infection; Note: no testing for hepatitis B and hepatitis C is required unless mandated by local health authority
* The patient has known and active alcohol or drug dependency
* The patient has a concurrent active malignancy other than treated non-melanoma skin cancers or in situ neoplasm; a patient with a prior history of malignancy is eligible, provided that they have been free of disease for \>= 5 years
* Patients may not have features suggestive of myelodysplastic syndrome (MDS) or acute myelogenous leukemia (AML) on peripheral blood smear or bone marrow biopsy, if clinically indicated
* Patients may not have had a prior allogeneic bone marrow transplant or double umbilical cord blood transplantation (dUCBT)
* Patients may not have current signs and/or symptoms of bowel obstruction within 1 month prior to starting study drugs, except if it was a temporary incident (improved within \< 24 hours \[hr\] with medical management)
* History of hemoptysis within the last 1 month
* History of abdominal fistula, intra-abdominal abscess, or gastrointestinal perforation within the last 3 months
* Dependency on IV hydration \> 1 day per week within the screening period
* Participants receiving any medications or substances that are strong inhibitors or inducers of CYP3A4/5 are ineligible; the required washout period prior to starting treatment is 2 weeks for CYP3A inhibitors, 3 weeks for CYP3A inducers, and 5 weeks for enzalutamide; dihydropyridine calcium-channel blockers are permitted for management of hypertension
* Whole blood transfusions in the last 120 days prior to entry to the study (packed red blood cells and platelet transfusions are acceptable)
* Involvement in the planning and/or conduct of the study (applies to both AstraZeneca staff and/or staff at the study site)
* Previous enrollment in the present study
* Current use of natural herb products or other complementary alternative medications; if used previously, patients must have at least 1-week washout and must stop using them while participating in this study