I am from Bangladesh. I am looking to apply for a PhD in Germany. 3 years back I was studying in Canada for a Bachelors degree, I was one semester short of graduating. Unfortunately due to COVID hitting my family business hard, I was unable to afford tuition and living expenses. I subsequently became homeless for about 4 months. While I was homeless I had my laptop and some expensive looking clothes and belongings. I was attacked by other homeless people quite badly twice (It was caught on CCTV once and the police came and took my statement and said they would like me to stand witness). This entire episode of me being homeless was a great shock to me. I was 1 semester away from graduating from a global top 100 school and I come from an upper middleclass family - I had never experienced something so extreme. When you add the assaults that I experienced - it left me in a very fragile mental state. Eventually after the second assault on me, I completely lost my senses. I started to get extremely paranoid.
A family friend invited me to come to Toronto to live with them. But my paranoia and weakened mental state had gotten the better of me, I left his house to live on the streets. I don't have much memory of that time other than being extremely scared and paranoid. The Toronto police found me by a public park yelling unintelligible things at them or sometimes at thin air. I believe I threw an empty plastic coffee cup at them because I was scared. They took me to the hospital. They found my passport on my person and because they had no emergency contact on their file for me so they called my embassy. They talked with a consulate diplomat who knows me (from previous passport renewals and meeting him once) and the diplomat from my consulate called my family back home, arranged to pay for my plane ticket and brought me back home before my visa expired. As far as I know the police did not call CBSA (Canadian Border Security Agency), and I was not deported (I called CBSA later on and they confirmed that there is no removal orders or deportation orders against me).
The diplomat had talked to my uncle, he said that there was no criminal case to my name. And "they did not take any action against him, there is only a record of him being homeless in Toronto." (paraphrasing). Back home I was taken to see a doctor and put on meds. I recovered pretty fast, the doctor did not officially diagnose me with a chronic mental illness, only said that I should keep taking the medication just to be safe since I had one episode of psychosis.
I am on my way to completing my Bachelors degree in Bangladesh with really good grades. I have always been a top student even in my O levels and A levels. I have no criminal record neither in Canada or Bangladesh. I plan on doing my Masters and PhD in Germany as I am in Computer Science and I find the Blue Card prospects quite attractive.
My question is: will my ordeal in Canada negatively affect my chances of getting a visa to Germany ? I would like to state again that I have no criminal record and I was never deported or overstayed my visa, I left willingly before my visa expired. My main concern is the content of my ramblings when I had lost my mind. I was extremely paranoid, I wasn't violent but I was yelling unintelligible things and I have some vague memories of yelling paranoid anti-government things. The police obviously did not take me seriously and took me to the hospital. I remember clearly the hospital declared me as not being a threat to myself or the public and they were gonna release me after giving me medication. Will this ordeal negatively affect my German visa application and should I mention this ordeal in my application ?