Boolean subsetting not producing incorrect differing lengths in R

I am trying to use a function that requires vectors of the same length, specifically those that match some indices. PairOrientation is a character vector with three possible values 'd','t', or 'c' that I use to subset my factors. PairOrientation and all the factors are the same lengths before subsetting. Each factor is either a vector of type integer or numeric. Somehow when I apply the subset, g1e and g2e end up being shorter by a small factor than all the other factors. The vectors g1 and g2 do not appear to have any NA entries, Inf, -Inf, or any other odd business going on. Are there any cases in R in which subsetting by the same boolean vector might cause the subsetted vectors to have different lengths? Thanks!

# SUBSET
ornts <- names(table(PairOrientation))

# LOOP THAT WILL BE USED TO RUN FUNCTION AFTER SUBSETTING  
  for(i in 1:length(ornts)){
    
    pO <- PairOrientation == ornts[i]
    
    # FACTORS
    g1e <- g1[pO]
    g2e <- g2[pO]
    doubletScore <- neighbor_grab(bplus,chrkey)[pO]
    TFInventory <- neighbor_grab(jacTF,chrkey)[pO]
    Closeness <- log(1/neighbor_grab(intrachr_dist,chrkey))[pO]
    DeltaChromatin <- log(1/nbrChromatin)[pO]
    Permissiveness <- nbrOpen[pO]
    
    print(paste(length(g1e),length(doubletScore),length(Closeness),length(g1exposure)))
    
  }