Agreed. That's my strategy for my road bike as well. For an ebike though? The whole point is to make getting places and doing errands easier. I use a cheap beater bike for this kind of trip. I think the only real solution to it right now is to try and mitigate theft with good locks, get insurance for the bike, and have a backup plan for when it inevitably gets stolen anyways. VanMoof including an insurance/replacement policy with their bikes is actually a killer feature I didn't know about.
From my experience, the absolute best thing is "out of sight, out of mind", so park your e-bike in a dedicated parking garage at work, or in a locked shed or inside your home, if at all possible. I live in an area with loads of bike thefts, and luckily this has saved me so far. I would almost go so far to say that I wouldn't use my e-bike unless I knew in advance that I could lock it up somewhere off the street.
https://ampedcycling.com/where-should-i-park-my-electric-bik...