Inclusion Criteria:  Pathologically confirmed diagnosis of locally advanced or metastatic solid tumours, e.g. adenocarcinoma of the lung, colorectal cancer, pancreatic cancer or cholangiocarcinoma. Non-small cell lung cancer (NSCLC) patients with mixed histology are eligible if adenocarcinoma is the predominant histology. Documented disease progression despite appropriate prior standard therapies or for whom no standard therapy exists for their tumour type and disease stage. KRAS mutation status: Kirsten rat sarcoma virus homolog (KRAS) glycine-to-cysteine (G12C) mutation in tumour tissue or blood based on previously performed local testing using a validated test. Provision of archival tumour tissue, if available, to confirm retrospectively KRAS G12C mutation status and for biomarker assessment. Only parts B and C monotherapy and combination therapy: Willingness to undergo pre- and on-treatment tumour biopsies for pharmacodynamics and biomarker assessment.  Patients can be enrolled without tumour biopsy upon agreement between the Investigator and the Sponsor if tumour biopsy is not feasible.  In addition, pre- and on-treatment biopsies are optional for part A monotherapy and combination therapy.  At least one target lesion that can be measured per Response Evaluation Criteria In Solid Tumours (RECIST) version 1.1 (radiated lesions do not qualify as target lesions). In patients who only have one target lesion, and a biopsy of the lesion is required, the baseline imaging must be performed before the biopsy or at the earliest two weeks after the biopsy. Eastern Cooperative Oncology Group (ECOG) performance status of 0 or 1.  Adequate organ function as follows:  Absolute neutrophil count (ANC) ≥1.5 x 109/L (equivalent values: ≥ 1.5 x 103/μL or ≥ 1500/mm3); hemoglobin ≥9.0 g/dL (equivalent values: ≥ 90 g/L or ≥ 5.6 mmol/L); platelets ≥100 x 109/L (equivalent values: ≥ 100 x 103/μL or ≥ 100 x 103/mm3) without the use of haematopoietic growth factors. Total bilirubin ≤1.5 times the upper limit of normal (ULN), or ≤4 x ULN for patients who are known to have Gilbert's syndrome. Creatinine ≤1.5 x ULN. If creatinine is >1.5 x ULN, patient is eligible if concurrent creatinine clearance ≥50 mL/min (equivalent value: 0.84 mL/s) (measured or calculated by The Chronic Kidney Disease Epidemiology Collaboration (CKD-EPI) formula). Aspartate transaminase (AST) and alanine transaminase (ALT) ≤3 x ULN, for patients with liver metastases ≤5 x ULN.  Further inclusion criteria apply.  Exclusion Criteria:  - Previous anticancer chemotherapy within 3 weeks of the first administration of trial drug.  Previous anticancer hormonal treatment or anticancer immunotherapy within 2 weeks of the first administration of trial drug.  Previous treatment with Rat Sarcoma (RAS), Mitogen-activated protein kinase (MAPK) or Son of sevenless 1 (SOS1) targeting agents (only for monotherapy Parts A, B, and C). Radiotherapy within 2 weeks prior to start of treatment, provided recovery from related toxicity. Major surgery (major according to the investigator's assessment) performed within 4 weeks prior to start of treatment or planned during the projected course of the trial, e.g.  hip replacement.  Previous treatment with any investigational agent(s) or targeted treatment within 28 days prior to start of treatment or 5 half-lives, whichever is shorter. Known history of hypersensitivity to any of the excipients of BI 1823911 tablets. History or presence of cardiovascular abnormalities such as uncontrolled hypertension, congestive heart failure New York Heart Association (NYHA) classification of ≥3, unstable angina or poorly controlled arrhythmia which are considered clinically relevant by the Investigator. Myocardial infarction within 6 months prior to start of treatment. Uncontrolled hypertension is defined as: Blood pressure (BP) measured in a rested and relaxed condition, where systolic BP >=140 mmHg, or diastolic BP >= 90 mmHg, with or without medication. Left ventricular ejection fraction (LVEF) <50%. Further exclusion criteria apply.