Something similar happened on the Float X2 that I had. I had a few people, maybe on here, tell me that it could be grease in the equalization ports of the air spring. It seemed to go away after the first squish or two and the shock worked great. I don't know if that's what's going on here, but it never proved to be more than an annoyance.
I fixed it by getting a different shock. shrug.ascii
My 2018 X2 did that after a little while. Sent it to my a friend in Squamish who has been doing a side hustle rebuilding Fox shit. He said it was air in the oil caused by a quad ring that fails easily. Fox has since upgraded the material. He rebuilt mine with the latest spec. Don't know what year yours is or when they started using the new material rings.