Error 'subscript out of bounds'

we dont have your preceding code or data; so our ability to help you is limited.

reprex-guide
You seem to have a rather convoluted data structure.
multidimensional matrices? or lists in lists ? or a mix of the two ?

things to think about
why is it safe to range j from 1 to 50 ?
why is it safe to range i from 1 to 639 ?
for each j ( 1 to 50) would there be a "B1PRSEX" at the end of imputations[["imputations"]][[paste("imp",j,sep="")]] ? would it have 1:639 elements?