Is table.insert(table, index, value) overwriting future indexing if there is no value in previous index intentional?

I’m working on some priority systems for module I’m making and I’ve run into an issue where:
If player does (for example) table.insert(t, 999, value) and then does table.insert(t, 999, value1) value is not shifted into 1000 but instead overwritten by value1 set afterwards.

I’m just simply surprised by this inconsistency and flabbergasted that I’ve never noticed this before.

How to replicate:
Use Roblox’s studio output console and simply input one-liner:

local t = {} table.insert(t, 999, "b") table.insert(t, 999, "a") print(t)

I believe this is normal behavior in Lua 5.1 (and Luau by extent), but later versions of stock Lua changed it so if you pass an index greater than or equal to the table length it will error.

More specifically, this happens because {[999] = "A"} is a dictionary with 999 as a key, not an array like table.insert expects. If there were preceding indices/keys that started from one with no holes, it would shift the value over instead of overwriting.

Oh I forgot to remove said key in the one-liner I sent but the behavior is the same even if there is no initial key value set, essentially the result is same either way.