The best tool for this I've found so far is Logseq [0]. The only things that come close in functionality are some really custom Emacs roll-your-own things that were just too hard for me as a basic Doom Emacs defaults user, and Anytype. However, I couldn't understand the storage of Anytype enough to convince me that my work would be okay with it (e.g. encryption, but IPFS-ing your files all over the place, maybe?).
Anyway, here are the reasons to consider Logseq for a "lab journal". Note all of these features are unique to Logseq (except the ones I note, afaik), but the subset of them are from what I can tell:
1. Local storage: this is just messing around with markdown on a local file. You can keep it in your corporate storage as a regular folder, at home, it is completely separate from your data sync setup and you can choose what you want. They are working a new database-backed version of the files for faster querying (though I have >10k files in it now and it does fine).
2. Open source: Obsidian, a popular alternative, is not open source. Considering this carries confidential info and all my personal stuff (not at work though!), I gotta trust my tools.
3. Killer feature that only Logseq has: custom, datalog query engine to query your existing notes and aggregate things. Other tools have some similar thing, but it's mostly akin to "search" and possibly ANDing some terms together, but Logseq has much more advanced uses enabled by this engine.
The datalog and querying feel initially like a "draw the rest of the owl" meme, as it is up to you to decide whether you want to create namespace hierarchies (e.g. should your `vim` page be `devtools/vim`, just `vim`, or tagged with `devtools`?), but once you figure out a system, it takes a bit to craft a few clever queries and reuse them with templates.
I have a reasonably slick system for this, where I have a set of queries prioritized by due date / priority on my home page, along with incoming (waiting for someone) and outgoing (someone waiting on me) dependencies. I organize things with a series of "project" pages that each have a very long query to aggregate all my daily journal entries (and other pages) that are tagged with anything related to that project page (e.g. I have a page `CMake Template Repository` where I'm trying to create a github template repo for C++ projects so I don't have to write it from scratch each time). It has really helped me get things done despite having a bit of ADHD. If there's enough interest, I can try to write this up in a blog post.
[0] https://logseq.com/