neilmcdowell I tried with Basic authentication as mentioned by @jens_E and @mrudella but it didn't work for me. I'm getting 5.7.139 error. I searched online and saw some "solutions" about using Conditional Access Policies but we don't have this enabled in our Entra subscription. The other "solution" would be to disable security defaults for all users but I didn't want to do that.
So back to modern authentication and I think that I finally got it working after a few hours!
I didn't create a new app as suggested by @KevinTheJedi , I went into the plugin in osTicket and deleted the corresponding instance(s). Then I completely deleted the email account as well (it was easy for me because we only used this account for sending). Then I created it again, used the same settings as before, but changed the Scopes to "offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send" as suggested by Kevin (don't know if this made a difference).
I saved and got the token, then went to the Outgoing (SMTP) tab, enabled and it worked.
//edit: Actually there's another difference, I was using an alias before in the account's "Email Address" field. I also changed this to the "proper" address. I was doing this because an agent also had this address so it didn't let me use it for the account, but now I switched them (put the alias to the agent and used the proper one for the account)