If you need long range, you need diesel. On a monohull sailboat, no matter how many solar panels and controllers you can afford, you just can't hang enough of them in a way that they are never shaded by mast and sails, to keep going day and night, or to approach hull speed without depleting batteries. Regen doesn't do much for you, unless your speed under sail is up in the double digits. And honestly, hull speed is not a very realistic electrocruising speed at all. E-boats are generally driven at about half of hull speed, or less, in order to increase range. Push the hull hard, and you reduce your range dramatically. Going fast is cool, but you will only do it when you only need to run the motor for a half hour or so, typically.
Where electric drive really shines is for boats that are SAILED, and only need mechanical propulsion for docking and other maneuvering, such as bridge passages and power tacking. Yup, that's a thing. Since electric power is instantly available with no warmup or startup sequence, if your boat tacks like a pig or your foredeck crew are more hindrance than help, just twist the knob and force her head across the wind. Works great with full keel boats, even. Electric is good also because there is no minimum idle speed. No need to "bump it" in and out of gear. Much easier to steer while making sternway. Or come alongside your finger pier, grab your near side stern line and drop it on the cleat, and come ahead dead dead dead slow against it while you singlehandedly make all your other lines fast. Back into the wind, for really slow approaches to a pumpout station or fuel dock, and crabwalk right in there like you have twin screws or a bow thruster. Once you really learn how to use an e-drive, you will hate docking a diesel boat. And kw/hrs of shore power are cheap. Charge your batts overnight and you are ready for a day trip in the morning.
BUT... there is the range thing. Yeah you can get more batteries, but there is a practical limit. I have a 7600 lb boat and I have about 600 lbs of batteries, more or less, 10.56kw/hrs of storage. If I double that, well, you do the math. I got rid of maybe 450 lbs of engine and fuel tank and assorted associated stuff, but added 600 in batteries and 35 in motor and controller. No biggie, so far. Adding another 600 would not be a deal killer but just finding room for 8 more golf cart batteries is something I have agonized over. Still ANOTHER bank, would be horrible to contemplate, and I would still have less than 32kw/hr of total storage, of which only half would be routinely considered active and usable. You CAN discharge lead acid batteries down to 40% once in a while, and one or two dips to 30% might be acceptable in emergency, but basically, the rule of thumb is 50% DOD. YMMV. Now I have calculated that under reasonable conditions on Lake Pontchartrain, Louisiana's own inland sea, I currently have an absolute range at 1 knot or so of 100nm from 50% DOD. If I double the speed, I don't cut the range in half. I cut it way more than half. At 5kt I probably have a range of 6 or 7 miles. So I can have modest range at very low speed, or I can have good speed with very low range, but not the best of both. Adding enough batteries to make the boat nearly impossible to live on, (I am a liveaboard) would still have me short of being able to electrocruise to Florida. Now since my mast and sails are gone and will never reappear, I can put up a solar canopy over the entire boat, an upcoming project, and possibly crowd as much as 2kw of solar up there. That would possibly give me a round the clock electrocruise speed of maybe 2-1/2kt, I don't know, if the sun shines all day. That's okay, for me. Is it okay for you? And you will be lucky to be able to mount 1/5 that much solar where the sails and rigging never shade them.
It can be a lot cheaper to repower electric, IF you are willing to learn an awful lot about electric and propulsion engineering, and mix and match your own off the shelf components. Or it can be somewhat cheaper to install a beta diesel than to install a full turnkey e-drive system. There is more room for the owner to do the engineering and sourcing and adaptification and installation, thereby reducing total cost, than with diesel. On top of that, most new diesels must be installed by an authorized mechanic, Beta being one exception. So yeah, you can DIY your electric propulsion system. But without a LOT of study and research and good basic knowledge of electricity and electronics and engineering background, you are likely to end up with a bunch of junk that is unreliable or even dangerous, and inefficient or ineffective at performing its intended function.
Go diesel, if you are concerned with range. Period. If you just want the advantages (there are many) of electric, and you don't need the range and speed of a diesel, then by all means, come over to the dark side. I love electric, but it isn't for everyone.