I believe the script did as what it was intended to do.
What you might’ve mistaken is that you parented the character to the original template’s viewport; in order to fix the issue ur having all you need to do is to just define the viewport in the newTemplate that you cloned
for i, v in pairs(chars:GetChildren()) do
print(v)
local newTemp = template:Clone()
newTemp.Parent = script.Parent.Frame.Select
newTemp.Name = v.Name
local clone = v:Clone()
clone.Parent = newTemp.ViewportFrame
newTemp.CharName.Text = v.Name
end