How do you use numPerms to get the total number of unique permutations for a PERMANOVA? I am trying to calculate the number of unique permutations for a PERMANOVA using the R adonis2 function but I am getting stuck on defining my permutation scheme.
As suggested here I am using the numPerms function from the permute package to get the answer. However, I am getting stuck with how it works, even in simpler designs. Here is an example with an attempt:
# Create sample dataframe with counts for 3 species from 10 different locations
# Counts are randomly generated from 1-100
set.seed(2)
df = data.frame(
  sp1 = sample(1:100, 10),
  sp2 = sample(1:100, 10),
  sp3 = sample(1:100, 10)
)

# Create a vector of data with 2 groups of 5. 
myGroups = c(rep("A",5), rep("B", 5))

# Define the permutation scheme. 
hh = how(blocks = as.factor(myGroups))

# My PERMANOVA would therefore be as follows with the permutation scheme specified (I think?)
adonis2(df~myGroups, perm = hh)

# Calculate number of permutations
numPerms(df, hh)

However, $2$ groups of $5$ should have $126$ unique permutations (e.g., see here), but this returns $14400$. What did I do wrong?

You did nothing wrong; {permute} doesn't know how to do permutations of the sort you want.
The permutation test you described via how() is a randomization test restricted by blocks, so there are 5! * 5! such permutations, which is what numPerms() returns.
