As someone who's built a few engines and also worked with third party ones: It really isn't the hard part for a 2D game. High fidelity 3D, different story. But something like Stardew Valley, I'd dare to say custom engine and something like Unity is pretty similar in effort, considering that you need to deal with doing things in the engine's way, which requires workarounds and what not. Bringing it to many platforms gives the engine a head start, but I'd say it's comparable.
Iterating on the game content itself: _Insane_ amounts of effort, in my experience.
Building an engine is a famously huge time sink, to the point where the standard advice is to make a game or an engine, but not both if you want to ship.
As always, it depends. Building something like Unity/Unreal that should support everything and everyone under the sun, one way or another? Yeah, huge time sink.
But a 2D engine that should only support exactly what the features need from Stardew Valley? Doesn't seem insurmountable, although I wouldn't exactly take that approach myself.