A lot of people in here clearly not from the US or if they are, they are incredibly ignorant as to how the police operate here. Again, this is only applicable to the US, I can't speak to any other country.
Suicide-by-cop is absolutely a thing.
If the cops believe you are armed, they are trained to use lethal force. They aim center mass, and keep firing until you stop moving. If you pull out something that at a quick glance could be mistaken for a gun, you are going to be shot multiple times in the chest and abdomen and the cops aren't going to be in a hurry to get you any medical attention. There's a very real chance, but not a guarantee, you'll be dead before your body even catches up to the fact you've been shot and starts feeling pain.
Here's how it would kinda play out:
Rustle up something that could be mistaken for a gun. You could just keep your hand in your jacket and then suddenly pull it out when ready and hope they go for it, but to be safe you want something in your hand. Even something as simple as a few gun-shaped pieces of cardboard taped together and turned black with a Sharpie will work. Other options include a garden hose nozzle, a Playstation controller, an NES Zapper, whatever. The cops are going to be on a hair trigger and are going to give you the benefit of the doubt that your object that you are saying is a gun is actually a gun.
Go some place where there aren't a lot of people lollygagging about, you don't want random bystanders to get hit if the cops can't aim for shit or with a ricochet. You also don't need any actual people around to threaten or any gun-wielding MAGA type cowboys to complicate matters.
Using your cell phone, or if you've accidentally found yourself backwards in time, use a payphone. Call 911. You would tell them you have a gun and you're going to start shooting unless the cops send someone to stop you right away. They will suspect you're trying to suicide-by-cop and ask you a bunch of dumbass questions, but they aren't allowed to ignore you and WILL send officers to your location. They are trained to assume you are serious and mean business. They are also not going to go through a bunch of mental math to figure out that there aren't any people near you for you to shoot.
Cops will soon arrive. Don't do anything yet. You want to wait for the full firing squad to arrive. Cops don't just show up 2 at a time for "I've got a gun and im gonna shoot people" call. Everyone on duty who is remotely nearby will show up. You need to give them time to arrive. There's no certainty in this part. You could end up with a yahoo who just gets out of the car and starts blasting when you don't immediately show him your hands. Not ideal, but you'll still probably die. Once you've got a dozen guns pointed at you, now's the time to suddenly whip out your fake gun and catch the bus.
Downsides:
Obviously the morality here is questionable since you're making other people complicit in your death. And like almost any other CTB method it has a chance to fail. In this case, the chance for outright failure is small. Surviving one gunshot is common enough, surviving a few dozen is rare. But in the event you DO somehow fail, the potential consequences are nasty. You ARE going to be shot to pieces, there's virtually no chance they are just gonna taze you or beanbag you and haul you in. So you'll be potentially crippled, deformed, paralyzed, whatever. Some commenters have talked about jail time, but that's not really a risk here. The number of crimes committed in this process will vary from state-to-state but they are few and probably not even felonies in most jurisdiction as long as you didn't actually have a gun. In addition, your medical situation and obvious suicidal tendencies will erode most desire to try and throw you in jail. You'll be in an ICU followed by a psych ward at a hospital and then when your insurance or Medicaid limits run out, they will send you home. Unfortunately there's a chance you won't be in a very good position to CTB again.
So, if you have other methods available to you, they are probably preferable. But if you are in the US, this is absolutely a viable plan.