Creating a loop for a regression model and store results

The stock column is created on this step gather(stock, return, starts_with("X")) %>% so I see no evident cause for that error message. Could you provide a REPRoducible EXample (reprex) for that issue?