Context. Recent studies have shown that close-in brown dwarfs in the mass range 35-55 M Jup are almost depleted as companions to stars, suggesting that objects with masses above and below this gap might have different formation mechanisms. Aims. We aim to test whether stars harbouring "massive" brown dwarfs and stars with "low-mass" brown dwarfs show any chemical peculiarity that could be related to different formation processes. Methods. Our methodology is based on the analysis of high-resolution échelle spectra (R ∼ 57000) from 2-3 m class telescopes. We determine the fundamental stellar parameters, as well as individual abundances of C, O, Na, Mg, Al, Si, S, Ca, Sc, Ti, V, Cr, Mn, Co, Ni, and Zn for a large sample of stars known to have a substellar companion in the brown dwarf regime. The sample is divided into stars hosting massive and low-mass brown dwarfs. Following previous works a threshold of 42.5 M Jup was considered. The metallicity and abundance trends of both subsamples are compared and set in the context of current models of planetary and brown dwarf formation. Results. Our results confirm that stars with brown dwarf companions do not follow the well-established gas-giant planet metallicity correlation seen in main-sequence planet hosts. Stars harbouring "massive" brown dwarfs show similar metallicity and abundance distribution as stars without known planets or with low-mass planets. We find a tendency of stars harbouring "less-massive" brown dwarfs of having slightly larger metallicity, [X Fe /Fe] values, and abundances of Sc ii, Mn i, and Ni i in comparison with the stars having the massive brown dwarfs. The data suggest, as previously reported, that massive and low-mass brown dwarfs might present differences in period and eccentricity. Conclusions. We find evidence of a non-metallicity dependent mechanism for the formation of massive brown dwarfs. Our results agree with a scenario in which massive brown dwarfs are formed as stars. At high-metallicities, the core-accretion mechanism might become efficient in the formation of low-mass brown dwarfs while at lower metallicities low-mass brown dwarfs could form by gravitational instability in turbulent protostellar discs.