I learned "goldbrick" from WWI war stories, in which incompetent second lieutentants who had gotten commission
by family possessing political influence were so referred to. It was also applied to privates who were talented at evading assignments that required physical or mental exertion. The analogy was to confidence men convincing suckers they were rich by exhibiting a brick covered with gold foil.