It was, though.
Objectively. This is not an opinion.
Switch 1 carts HAD to be purchased from Nintendo. It wasn't an off the shelf part. They weren´t SD cards priced commercially, they were a specific order that was part of manufacturing a physical copy and stacked up on top of printing labels and paperwork, making cases, shipping them to stores and so on. Margins for physical media are garbage as it is, but Switch carts were significantly more expensive than, say, a PS5 BluRay and they crucially ramped up quickly with size.
Technically the carts were available to higher sizes, but there's a reason you very rarely saw any Switch 1 games with cart sizes bigger than 16 gigs. Basically the more stuff you put in your game the more expensive it was to physically make the boxed copies. Crucially, that is a cost you had to pay whether you sold the carts or not. It was a manufacturing cost.
Look, at this point it's hardly worth it trying to wrap one's head around industrial retailed boxed copy software manufacturing, but trust me, physical Switch games were relatively and absolutely expensive to make in an environment where digital distribution was king and the next most expensive version was dirt cheap optical media.
I don't know that Nintendo was forcing the issue for profit. I also don't know the costs and margins (if any) for Nintendo or who they were working with to get the storage, to be fair. But I have to assume that if Nintendo had signficantly cheaper access to storage and was artificially throttling to everybody else you'd have seen more first party games on larger carts, and that wasn't necessarily the case.
Regardless, any solid state storage was always going to be more expensive than optical storage and scale up with size gradually in a way that optical storage doesn't (until you have to go to a second disk or an additional layer, at least). Cartridges are just inherently riskier and more expensive, even at the relatively modest spec of the Switch 1. Definitely with what seems like competitive speeds in Switch 2.
That doesn't mean one has to like the consequences of it. At the same time I'm not sure I can imagine a realistic alternative for a portable. We're not doing UMD again, so...