No, it is highly unlikely that Mercury could have been a gas giant at any point in its lifetime. Gas giants, such as Jupiter and Saturn, form in the outer regions of a planetary system where there is an abundance of gases, primarily hydrogen and helium. These planets form through a process known as core accretion, where a solid core forms first and then accumulates a massive envelope of gas.
Mercury, on the other hand, is the smallest and innermost planet in our solar system. It is a rocky planet, similar to Earth, Venus, and Mars. It lacks the mass and the favorable conditions required to accumulate and retain a substantial atmosphere, let alone the massive gas envelope characteristic of gas giants.
Mercury's proximity to the Sun is one of the main reasons it couldn't have been a gas giant. The intense heat and radiation from the Sun would have stripped away any primordial gas envelope that might have formed around the planet during its early stages of development. Additionally, the solar wind, which consists of charged particles emitted by the Sun, would have swept away any tenuous atmosphere that Mercury could have acquired.
Therefore, based on our current understanding of planetary formation and the specific conditions surrounding Mercury, it is highly improbable that it could have ever been a gas giant.