Only a portion of this script works

This is a script which automatically gives you your morphs according to you being in the group and having the proper role and the team you’re on. The problem with this is that only a portion of it works, the rest doesn’t

local ServerStorage = game:GetService("ServerStorage")
local morph = ServerStorage:WaitForChild("AutoMorph_Storage")

return {
	Teams = {
		["The Universal Union"] = {
			Configs = {
				[16221838] = {-- Group id
					["Overwatch Commander"] = { -- Rank id 
						Morph = morph.CMB["CMB - Interim Administrator"]
					},
					[16221838] = {-- Group id
						["Interim Administrator"] = { -- Rank id 
							Morph = morph.CMB["CMB - Interim Administrator"]
						}
					}
				}
			}
		},
		["Civic Workforce"] = {
			Configs = {
				[16221838] = {-- Group id
					[255] = { -- Rank id 
						Morph = morph.CWU["CWU - Tram Driver"]
					},
					[16221838] = {-- Group id
						[1] = { -- Rank id 
							Morph = morph.CWU["CWU - Tram Driver"]
						},
					}
				}
			}
		},
		["The Resistance"] = {
			Configs = {
					[16221838] = {
					[255] = {
						Morph = morph.REBEL["REBEL"]
					},
					[0] = {
						Morph = morph.REBEL["REBEL"]
					}
					}
			}
			}
	}
}

Not a scripter, so I need help here, the

					["Overwatch Commander"] = { -- Rank id 
						Morph = morph.CMB["CMB - Interim Administrator"]

portion works, and gives the morph correctly for those who are ranked Overwatch Commander, however, for all the other ranks it doesn’t seem to work? Is there a problem with my brackets? I just kept putting brackets until the errors went away.

local ServerStorage = game:GetService("ServerStorage")
local morph = ServerStorage:WaitForChild("AutoMorph_Storage")

return {
	Teams = {
		["The Universal Union"] = {
			Configs = {
				[16221838] = {-- Group id
					["Overwatch Commander"] = { -- Rank id 
						Morph = morph.CMB["CMB - Interim Administrator"]
					},
					["Interim Administrator"] = { -- Rank id 
						Morph = morph.CMB["CMB - Interim Administrator"]
					},
				}
			}
		},
		["Civic Workforce"] = {
			Configs = {
				[16221838] = {-- Group id
					[255] = { -- Rank id 
						Morph = morph.CWU["CWU - Tram Driver"]
					},
					[1] = { -- Rank id 
						Morph = morph.CWU["CWU - Tram Driver"]
					},
				}
			}
		},
		["The Resistance"] = {
			Configs = {
				[16221838] = {
					[255] = {
						Morph = morph.REBEL["REBEL"]
					},
					[0] = {
						Morph = morph.REBEL["REBEL"]
					}
				}
			}
		}
	}
}

This code could fix your problem. The problem here could be that you’re putting group IDs inside the “ranks” table.

[16221838] = {-- Group id
	["Overwatch Commander"] = { -- Rank id 
		Morph = morph.CMB["CMB - Interim Administrator"]
	},
	[16221838] = {-- You're looking for a rank id not the group id
		["Interim Administrator"] = { -- Rank id 
			Morph = morph.CMB["CMB - Interim Administrator"]
		}
	}
}

Should be:

[16221838] = {-- Group id
	["Overwatch Commander"] = { -- Rank id 
		Morph = morph.CMB["CMB - Interim Administrator"]
	},
	["Interim Administrator"] = { -- Rank id 
		Morph = morph.CMB["CMB - Interim Administrator"]
	}
}