I'm not really sure what GetMaxBags() does, but it will probably return number of bags, not numbers of slots in bag. I think you can use (I didn't test it in game):
lua Code:
local _, numSlots = GetBagInfo(BAG_BACKPACK)
or
lua Code:
local numSlots = ZO_InventoryManager:GetNumSlots(INVENTORY_BACKPACK)
or
lua Code:
local numSlots = PLAYER_INVENTORY.inventories[INVENTORY_BACKPACK].numSlots