Your second fit contains collinear factors. I know because you defined them that way! No two variables in a linear model can be "recreated" value-by-value using any linear combination of other variables in the model. Otherwise you arrive at rank deficiency. R is smart enough to just drop redundant factors, so it simply sets your second and third coefficients to missing in the second model.

When R does this, it assumes that you did not do so in such an obvious way. For instance, if you adjusted for 100 factors, you may arrive at deficiency and not know it. For that reason, when you predict, R reminds you that the prediction model is *so* overadjusted, there is almost certainly a problem of overfitting that will not give you reliable predictions. There are methods to accommodate high dimensional predictions.

Take this example of using n=50 observations to fit a 50 feature prediction model versus a 20 feature prediction model.

    set.seed(1)
    
    p <- 50
    n <- 200
    
    b <- rnorm(p)
    x <- matrix(rbinom(p*n, 1, .3), n, p)
    x <- as.data.frame(x)
    y <- rnorm(b %*% x)
    X <- data.frame('y'=y, 'x'=x)
    train <- do.call(c, mapply(rep, 1:0, each=c(50,150))) == 1
    
    ## all factors are "important", but fit2 with the first 20 preds more
    ## generalizable
    fit1 <- lm(y ~ ., subset=train, data=X)
    fit2 <- lm(y ~ ., subset=train, data=X[, 1:21])
    
    pred1 <- predict(fit1, newdata = X[!train, ])
    pred2 <- predict(fit2, newdata = X[!train, ])
    
    var(y[!train] - pred1)
    var(y[!train] - pred2)

results in

    > var(y[!train] - pred1)
    [1] 18.34429
    > var(y[!train] - pred2)
    [1] 1.269684