This is really cool. I recently attempted to build a toy database, and subsequently implemented my own b-tree (
https://github.com/spandanb/learndb-py). I ended up running into a lot of these issues.
I also did a write-up on why everyone should engage in similar projects: https://www.spandanbemby.com/joys-of-database.html