At the risk of sounding like-- or becoming-- one of those pedantic no-longer-quite-noobs who just want to rave about their own bikes...
There are options for safe and capable EMTBs under $4,000, even under $3,000, with quality components. I say this because I'm riding one.
They are not, however, easy to find, they may require some upgrades, and also very likely some compromises, and most people are not going to want to put in the time, effort and patience to research and source one.
With delivery and mods, my Motobecane ULTRA eAdventure cost $2,500 before tax. It now weighs 46 pounds, and I am riding trails rated as Blue/Black or "Intermediate/Difficult" by MTB project-- albeit slowly and carefully, but that's more due to my own inexperience than the bike's components or capabilities. It could probably safely handle many single black diamond trails, though probably not a double.
I'm not trying to hijack this thread, which has drifted towards higher-end EMTBs. Obviously, I never would have gotten this far without EBR. And reading about expensive bikes has been really helpful for learning what's important, and safe, for me. If it weren't for you guys, I'd probably be sitting here waiting for a Nireeka Homie to ship... or packing it up to send it back after its first problems. (That was a REALLY close call. Phew!)
I'm just saying, if you're lurking, and you're discouraged by high prices, keep listening, keep watching, keep trying, and consider whether there might be compromises you could make that won't compromise your safety for the type of riding you want to do. For me, being relatively fit and underweight, it made sense to compromise on battery size and power, for someone else, it might be something different-- or there might be fewer compromises that were possible.
I agree with John that it's possible to enter the sport at a lower price point, though I'm not sure that $1,200 is quite practical. I sure tried-- on paper-- but whenever I got below about two grand, I felt like I was going to compromise (particularly on suspension or drive train) in a way that didn't seem safe to me.
At about two grand, I started seeing bikes where I thought, "Well, I'll probably have to do some upgrades, but this will probably work."
I know... I am still definitely in the honeymoon phase.
I got it bad. After a ride, I like to lie on the couch with the dogs and just... stare at it.
And yes, it does have to stay on a stand in the living room, at least for now.