Testing the Addition of an Anti-cancer Drug, Copanlisib, to the Usual Immunotherapy (Nivolumab With or Without Ipilimumab) in Patients With Advanced Solid Cancers That Have Changes in the Following Genes: PIK3CA and PTEN

This phase I/II trial studies the side effects and best dose of copanlisib when given together with nivolumab and ipilimumab and to see how well they work in treating patients with solid cancers that may have spread from where it first started to nearby tissue, lymph nodes, or distant parts of the body (advanced) and have changes in PIK3CA and PTEN genes. Copanlisib may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. Immunotherapy with monoclonal antibodies, such as nivolumab and ipilimumab, may help the body's immune system attack the cancer, and may interfere with the ability of tumor cells to grow and spread. The addition of copanlisib to usual immunotherapy may work better in treating patients with solid cancers compared to usual immunotherapy alone.

PRIMARY OBJECTIVE:

I. To evaluate safety and confirm the combination recommended phase 2 dose (RP2D) of the combination of copanlisib, nivolumab (and ipilimumab) in patients with molecularly-selected advanced solid tumors.

SECONDARY OBJECTIVES:

I. To observe and record antitumor activity. II. To assess clinical benefit of copanlisib in combination with nivolumab (and ipilimumab) in patients with molecularly-selected advanced solid tumors, as measured by objective response (OR) = complete response (CR) + partial response (PR).

III. To assess overall duration of response (DoR), progression free survival (PFS), and overall survival (OS).

IV. To assess immune-modulatory changes associated with copanlisib-induced PI3K inhibition and combination of copanlisib and nivolumab (and ipilimumab).

V. To correlate molecular alterations in the PI3K-AKT pathway and treatment induced immune-modulatory changes with objective response (OR).

EXPLORATORY OBJECTIVES:

I. To perform molecular profiling assays on malignant and normal tissues, including, but not limited to, whole exome sequencing (WES), ribonucleic acid (RNA) sequencing, reverse phase protein array (RPPA), circulating tumor deoxyribonucleic acid (DNA) analysis, and immune profiling in order to:

Ia. Identify potential predictive and prognostic biomarkers beyond any genomic alteration by which treatment may be assigned; Ib. Identify resistance mechanisms using genomic DNA- and RNA-based assessment platforms.

II. To contribute genetic analysis data from de-identified biospecimens to Genomic Data Commons (GDC), a well annotated cancer molecular and clinical data repository, for current and future research.

III. To bank formalin-fixed, paraffin-embedded (FFPE) tissue, blood (for cell-free DNA analysis), and nucleic acids obtained from patients at the Early-Phase and Experimental Clinical Trials (EET) Biobank at Nationwide Children's Hospital.

OUTLINE: This is a phase I, dose-escalation study of copanlisib followed by a phase II study. Patients are assigned to 1 of 2 trials.

TRIAL I: Patients receive copanlisib hydrochloride intravenously (IV) over 1 hour on days 1, 8, and 15 of cycle 1. Beginning in cycle 2, patients also receive nivolumab IV over 60 minutes on day 1. Cycles repeat every 28 days in the absence of disease progression or unacceptable toxicity. Patients undergo an x-ray and/or computed tomography (CT) scan during screening and every 8 weeks, as well as a tumor biopsy at baseline, cycle 1 day 15, cycle 2 day 15, and every 3 weeks thereafter, and at disease progression. Patients also undergo blood sample collection at baseline, cycle 1 days 8 and 15, cycle 2 day 15, cycle 4 day 1 and disease progression. Patients undergo echocardiography (ECHO) during screening and as clinically indicated on study.

TRIAL II: Patients receive copanlisib hydrochloride IV over 1 hour on days 1, 8, and 15 of cycle 1. Beginning in cycle 2, patients also receive nivolumab IV over 60 minutes on day 1 and ipilimumab IV over 90 minutes every 8 weeks for 4 doses. Cycles repeat every 28 days in the absence of disease progression or unacceptable toxicity. Patients undergo an x-ray and/or CT scan during screening and every 8 weeks, as well as a tumor biopsy at baseline, cycle 1 day 15, cycle 2 day 15, and every 3 weeks thereafter, and at disease progression. Patients also undergo blood sample collection at baseline, cycle 1 days 8 and 15, cycle 2 day 15, cycle 4 day 1 and disease progression. Patients undergo ECHO during screening and as clinically indicated on study.

After completion of study treatment, patients are followed up at 30 days and then every 3-6 months for up to 2 years.

Eligibility Criteria:
Inclusion Criteria:

* Patients must have histologically confirmed malignancy that is metastatic or unresectable and for which standard curative measures do not exist or are no longer effective
* Patients must be \>= 4 weeks beyond treatment with any chemotherapy or other investigational therapy to include hormonal, biological, or targeted agents; or at least 5 half-lives from hormonal, biological, or targeted agents, whichever is shorter at the time of treatment initiation
* Age \>= 18 years. Because no dosing or adverse event data are currently available on the use of copanlisib in combination with nivolumab (and ipilimumab) in patients \< 18 years of age, children are excluded from this study, but will be eligible for future pediatric trials
* Eastern Cooperative Oncology Group (ECOG) performance status (PS) 0-1
* Absolute neutrophil count (ANC) \>= 1,500 /mcL
* Platelets \>= 100,000 / mcL
* Hemoglobin \>= 9 g/dL
* Serum creatinine =\< 1.5 x upper limit of normal (ULN) OR measured or calculated creatinine clearance (glomerular filtration rate \[GFR\] can also be used in place of creatinine or creatine clearance \[CrCl\]) \>= 60 mL/min for subject with creatinine levels \> 1.5 x institutional ULN (creatinine clearance should be calculated per institutional standard)
* Serum total bilirubin =\< 1.5 x ULN OR direct bilirubin =\< ULN for subjects with total bilirubin levels \> 1.5 x ULN
* Aspartate aminotransferase (AST) and alanine aminotransferase (ALT) =\< 2.5 x ULN OR =\< 5 x ULN for subjects with liver metastases
* International normalized ratio (INR) or prothrombin time (PT) =\< 1.5 x ULN unless subject is receiving anticoagulant therapy as long as PT or partial thromboplastin time (PTT) is within therapeutic range of intended use of anticoagulants
* Activated partial thromboplastin time (aPTT) =\< 1.5 x ULN unless subject is receiving anticoagulant therapy as long as PT or PTT is within therapeutic range of intended use of anticoagulants
* Patients must have measurable disease by Response Evaluation Criteria in Solid Tumors (RECIST) version (v)1.1
* Patients must have a glycosylated hemoglobin (HbA1c) =\< 8.5% at screening and a fasting glucose of =\< 160 mg/dL
* Women of child-bearing potential MUST have a negative serum or urine human chorionic gonadotropin (HCG) test within 24 hours of study enrollment unless prior tubal ligation (\>= 1 year before screening), total hysterectomy or menopause (defined as 12 consecutive months of amenorrhea). Patients should not become pregnant or breastfeed while on this study. Sexually active patients must agree to use dual contraception for the duration of study participation and for 7 months after the last dose of study treatment for women of childbearing potential and 5 months for men with partners that are women of childbearing potential
* Patients need to have biopsiable disease to enroll on Trial 1 (copanlisib + nivolumab)
* Patients in dose escalation and expansion of all arms must have actionable mutations in either PIK3CA hotspot (E542, E545, or H1047 are accepted) or PTEN (except for specific wild type cohorts). Local testing in Clinical Laboratory Improvement Amendments (CLIA)-certified laboratory will be accepted. Only mutations that have been recognized as actionable by the MD Anderson Precision Oncology Decision Support (PODS) team will be accepted
* Ability to understand and the willingness to sign a written informed consent document
* Patients who have previously received PD-1/PD-L1/PI3K inhibitors will be eligible for this study

Exclusion Criteria:

* Patients who are receiving any other investigational agents
* Pregnant or breastfeeding women will be excluded from participation in this trial, as there is no significant clinical information regarding the effects of copanlisib, nivolumab, and ipilimumab on a fetus or newborn infant
* Known active hepatitis B or hepatitis C infection. All patients must be screened for hepatitis B virus (HBV) and hepatitis C virus (HCV) up to 28 days prior to study drug start using the routine hepatitis virus lab panel. Patients positive for hepatitis B virus surface antigen (HBsAg) and/or hepatitis B virus core antibody (HBcAb) will be eligible if they are negative for HBV DNA, these patients should receive prophylactic antiviral therapy. Patients positive for anti-HCV antibody will be eligible if they are negative for HCV RNA
* Human immunodeficiency virus (HIV)-infected (HIV1/2 antibody-positive) patients may participate IF they meet all the following eligibility requirements:

  * They must be on an anti-retroviral regimen with evidence of at least two undetectable viral loads within the past 6 months on this same regimen; the most recent undetectable viral load must be within the past 12 weeks
  * They must have a CD4 count \>= 250 cells/mcL over the past 6 months on this same anti-retroviral regimen and must not have had a CD4 count \< 200 cells/ mcL over the past 2 years, unless it was deemed related to the cancer and/or chemotherapy-induced bone marrow suppression

    * For patients who have received chemotherapy in the past 6 months, a CD4 count \< 250 cells/mcL during chemotherapy is permitted as long as viral loads were undetectable during this same chemotherapy
  * They must have an undetectable viral load and a CD4 count \>= 250 cells/mcL within 7 days of enrollment
  * They must not be currently receiving prophylactic therapy for an opportunistic infection and must not have had an opportunistic infection within the past 6 months
* Active infection requiring intravenous (IV) antibiotics or other uncontrolled intercurrent illness requiring hospitalization
* 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. Exceptions include vitiligo, type I diabetes mellitus, endocrine deficiencies including thyroiditis managed with replacement hormones including physiologic corticosteroids, Sjogren's syndrome
* Inability to comply with the study and follow-up procedures
* History of cerebrovascular accident (CVA), myocardial infarction, or unstable angina within the previous 6 months before starting therapy
* Has a known additional malignancy that is progressing or requires active treatment. Exceptions include basal cell carcinoma of the skin, squamous cell carcinoma of the skin that has undergone curative therapy, or in situ cervical cancer
* Has a known psychiatric or substance abuse disorder that would interfere with cooperation with the requirements of the trial
* Has known active central nervous system (CNS) metastases and/or carcinomatous meningitis. Subjects with previously treated brain metastases may participate provided they are stable (without evidence of progression by imaging for at least 4 weeks prior to the first dose of trial treatment and any neurologic symptoms have returned to baseline), have no evidence of new or enlarging brain metastases, and are not using steroids for at least 7 days prior to trial treatment. This exception does not include carcinomatous meningitis which is excluded regardless of clinical stability
* History of any clinically significant drug allergy or hypersensitivity to compounds of similar chemical or biologic composition to copanlisib, PI3K inhibitors, nivolumab, and ipilimumab (such as anaphylaxis or hepatotoxicity)
* Has known history of psoriasis even if not active at the time given may pose additional risks of immune activation with the combination regimen
* Patients with live vaccines and live, attenuated vaccines (prohibited for 30 days prior to study agents, during the study, and for 100 days after the last dose of study drug). Patients with inactivated vaccines are permitted
* Copanlisib is primarily metabolized by CYP3A4. Therefore, the concomitant use of strong inhibitors of CYP3A4 (e.g. ketoconazole, itraconazole, clarithromycin, ritonavir, indinavir, nelfinavir, and saquinavir) and strong inducers of CYP3A4 (e.g. rifampin, phenytoin, carbamazepine, phenobarbital, St. John's wort) is not permitted from 14 days prior to enrollment until the end of the study. Other medications that are prohibited while on copanlisib treatment include:

  * Herbal medications/preparations (except vitamins)
  * Anti-arrhythmic therapy other than beta blockers or digoxin
* Patients will be excluded if they have a condition requiring systemic treatment with either corticosteroids (\> 10 mg daily prednisone equivalents) or other immunosuppressive medications within 14 days of study drug administration. Inhaled or topical steroids and adrenal replacement doses \> 10 mg daily prednisone equivalents are permitted in the absence of active autoimmune disease. Patients are permitted to use topical, ocular, intra-articular, intranasal, and inhalational corticosteroids (with minimal systemic absorption). A brief course of corticosteroids for prophylaxis (e.g., contrast dye allergy) or for treatment of non-autoimmune conditions (e.g., delayed-type hypersensitivity reaction caused by contact allergen) is permitted. The use of corticosteroids as antiemetics prior to copanlisib administration will not be allowed