A Study of Seltorexant Compared to Quetiapine XR as Adjunctive Therapy to Antidepressants in Adult and Elderly Participants With Major Depressive Disorder With Insomnia Symptoms Who Have Responded Inadequately to Antidepressant Therapy

The purpose of this study is to assess the efficacy of seltorexant compared with quetiapine extended-release (XR) as adjunctive therapy to an antidepressant drug in treatment response in participants with major depressive disorder with insomnia symptoms (MDDIS) who have had an inadequate response to current antidepressant therapy with a selective serotonin reuptake inhibitor (SSRI) or serotonin-norepinephrine reuptake inhibitor (SNRI).

Major depressive disorder (MDD) is a common, serious, recurrent disorder. Seltorexant (JNJ-42847922) is a potent and selective antagonist of the human orexin-2 receptor (OX2R) that is being developed for the adjunctive treatment of MDDIS. The hypothesis for this study is that seltorexant is superior to quetiapine XR in leading to a response after 26 weeks of treatment (greater than or equal to \[\>=\] 50 percent \[%\] improvement on baseline Montgomery Asberg Depression Rating Scale \[MADRS\] total score), when administered as adjunctive treatment to an antidepressant in adult and elderly participants with MDDIS who have had an inadequate response to treatment with an SSRI/SNRI. The study will be conducted in 3 phases: a screening phase (up to 30 days), a double-blind (DB) treatment phase (26 weeks), and a post treatment follow-up phase (7 to 14 days after the end of DB treatment phase for all participants, and up to 196 days from baseline for participants who stop study treatment early). The total study duration for each participant will be approximately 32 weeks. Efficacy, safety, pharmacokinetics, and biomarkers will be assessed at specified time points during this study.

Eligibility Criteria:
Inclusion Criteria:

* Meet diagnostic and statistical manual of mental disorders-5th edition (DSM-5) diagnostic criteria for major depressive disorder (MDD), without psychotic features, based upon clinical assessment and confirmed by the structured clinical interview for DSM-5 Axis I disorders-clinical trials version (SCID-CT) diagnosed with first depressive episode prior to age 60. The length of the current depressive episode must be less than or equal to (\<=) 24 months
* Have had an inadequate response to at least 1 but no more than 2 antidepressants, administered at an adequate dose and duration in the current episode of depression. The current antidepressant cannot be the first antidepressant treatment for the first lifetime episode of depression. An inadequate response is defined as less than (\<) 50 percent (%) reduction but with some improvement (that is, improvement greater than \[\>\] 0%) in depressive symptom severity with residual symptoms present other than insomnia, and overall good tolerability, as assessed by the Massachusetts General Hospital-Antidepressant Treatment Response Questionnaire (MGH-ATRQ)
* Is receiving and tolerating well any one of the following selective serotonin reuptake inhibitor (SSRI) or serotonin-norepinephrine reuptake inhibitor (SNRI) for depressive symptoms at screening, in any formulation and available in the participating country: citalopram, duloxetine, escitalopram, fluvoxamine, fluoxetine, milnacipran, levomilnacipran, paroxetine, sertraline, venlafaxine, desvenlafaxine, vilazodone, or vortioxetine at a stable dose (at or above therapeutic dose level) for at least 6 weeks, and for no greater than 18 months in the current episode
* Have a hamilton depression rating scale (HDRS)-17 total score greater than or equal to (\>=) 20 at the first screening interview, must not demonstrate a clinically significant improvement (that is, an improvement of \> 20% on their HDRS-17 total score) from the first to the second independent HDRS-17 rating, and must have a HDRS-17 total score \>18 at the second screening interview
* Have a patient version insomnia severity index (ISI) total score \>= 15 as well as a clinician version of the ISI total score \>= 15 at the second screening visit
* Body mass index (BMI) between 18 and 40 kilogram per meter square (kg/m\^2), inclusive (BMI=weight/height\^2)
* Participant must be medically stable on the basis of the following: physical examination, vital signs (including blood pressure), and 12-lead electrocardiogram (ECG) performed at screening and baseline

Exclusion Criteria:

* Has a recent (last 3 months) history of, or current signs and symptoms of, severe renal insufficiency (creatinine clearance \[CrCl\] less than \[\<\] 30 milliliter per minute \[mL/min\]); clinically significant or unstable cardiovascular, respiratory, gastrointestinal, neurologic, hematologic, rheumatologic, immunologic or endocrine disorders. uncontrolled Type 1 or Type 2 diabetes mellitus
* Has a history of treatment-resistant MDD, defined as a lack of response to 2 or more adequate antidepressant treatments in the current episode, as indicated by no or minimal (\<25% improvement in symptoms) when treated with an antidepressant of adequate dose (per MGH-ATRQ) and duration (at least 6 weeks)
* Has history or current diagnosis of a psychotic disorder, bipolar disorder, intellectual disability, autism spectrum disorder, borderline personality disorder, somatoform disorders
* Has a history of moderate to severe substance use disorder including alcohol use disorder according to DSM-5 criteria within 6 months before screening
* Has any significant primary sleep disorder, including but not limited to obstructive sleep apnea, restless leg syndrome, or parasomnias. Participants with insomnia disorder are allowed