This is a false claim.
Weight-lifting does not make a person shorter. Although if done incorrectly, a person's posture could maybe be affected, this is unlikely and not the same. Weight lifting is actually supposed to help improve posture, if done correctly.
An article posted on Linkedin helps clarify the matter,
https://www.linkedin.com/pulse/does-weight-training-actually-stop-height-growth-tanush-soni/.
This article, written by Tanush Soni, who declares themselves a motivator, states that there is no scientific reason to support the claim that weight training can negatively affect height.
Soni cites an article from Healthline, which says that weight lifting is a myth. It also says the claim started in reference more to children than adults.
Instead, weight lifting as numerous benefits, including improved posture, increasing strength, and increasing bone strength index.