I wish languages made it easier (or possible) to track index ownership at compile time.

You can in Rust! You just bundle it with a lifetime.

But... This loses the reason people are using indices to begin with: because the borrow checker cannot track what they do.