The thing about running a bakery is you have to know your business very well. You have to bake everything before the start of business each day (very labor intensive), and then it has a short shelf life- a day for a lot of things, like pastries. If you bake too much, you’ll waste a lot of product and your costs will be too high. If you bake too little, you’ll run out early and lose sales.
Coffeehouse is a lower-maintenance business to run. Beverages always have higher profit margins than food. It’s very quick and easy to make coffee, even quality coffee, and your supplies have a longer shelf-life. There’s more competition, but running a coffeehouse would be way easier for most people, so it would have a higher chance of success. But I’d start with a coffee cart or something first, and keep costs really low until you can grow your business.