4.0 STRING.format bug
Godot version
4.0.beta6.official (7f8ecffa5)
System information
macOS, Mac mini, Intel UHD Graphics 630
Issue description

Steps to reproduce
var arr = [1, 2, 3]
#arr = [1, 2] # this line is correct
var template = "[Variant:{}] [type:{}] [value:{}]"
print(template.format([TYPE_ARRAY, typeof(arr), arr],"{}"))
Minimal reproduction project
I believe this is intentional, and it doesn't seem exclusive to 4.0.
Some additional handling is performed when
valuesis an array. Ifplaceholderdoes not contain an underscore, the elements of the array will be used to replace one occurrence of the placeholder in turn; If an array element is another 2-element array, it'll be interpreted as a key-value pair.
# Prints: User 42 is Godot.
print("User {} is {}.".format([42, "Godot"], "{}"))
print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]]))
https://github.com/godotengine/godot/pull/68838 may make it slightly clearer this is how it works. See also the GDScript Format String tutorial.
There are two usages with passing Array:
# Prints: User 42 is Godot.
print("User {} is {}.".format([42, "Godot"], "{}")) # A
print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]])) # B
If your array contains array, it will use usage B to format the string. You would get an error STRING.format Inner Array size != 2.
To format strings with usage A, try template.format([TYPE_ARRAY, typeof(arr), str(arr)],"{}").
I just realised that part of the original issue was not just the documentation. Rather, the error message that comes with an invalid array, which is needlessly vague. Still, the documentation part has been solved, so this could be closed?
Could you identify the specific PR fixing this?
I suppose that embellishing the description in https://github.com/godotengine/godot/pull/68838 is not enough. This obscure usage of the method may really need to be more verbose.