If we want to offer everyone a western lifestyle while being sustainable on the long run, the optimal world population is indeed estimated at around 1.5-2 billions (world population of 1950), and definitely under 3 billions.
https://www.theguardian.com/environment/2012/apr/26/world-po...
Or just Google "Optimal world population".
And generally you don't want current consumption level, you want much higher standards, because majority of world's population is living in poverty. Which means that Earth can't hold 8B people either unless humans improve their land use efficiency significantly, which is unlikely.
What we do is change what the land is used for. So I don't think this argument holds any water, TBH.
By the time the frontier was closed -- say late 1800s, pretty much all US land was owned by someone and ostensibly dedicated to some use. Yet we managed to increase our population quite a bit since then.
All European land was spoken for by the early middle ages. Yet they managed to grow their population too.
> it's possible to convert ground dedicated to cattle or agriculture and develop that into cities
Unless you find a way to generate food out of thin air, it's not possible. People living in the cities need to eat something.
The city of Los Angeles has a watershed which extends 1,500 miles eastward, to the western extent of the Rocky Mountains. The reason much of the Western US appears more as an island archipellago than a continuously inhabited terrain is because there simply isn't enough water to fill taps, flush toilets, and run showers, let alone grow food or provide range for livestock on an unirrigated "dry-land" basis. Even attempting that proved a major environmenal disaster, the Dust Bowl of the 1920s and 1930s.
For a brief introduction to his research, see "How Many People Can the Earth Support?" https://www.nybooks.com/articles/1998/10/08/how-many-people-...
Paywall: https://archive.is/E5AB8
He makes a much more complete exploration in his 1995 book, How many people can the earth support?, Cohen visits many estimates and/or claims regarding carrying capacity and explores the assumptions or logic behind many of these, which range from a low of about 100 million to highs over 12 trillion. Most such estimates cluster around 1--10 billion, and seem more credible than outliers, especially of the high-end group.
https://www.worldcat.org/title/how-many-people-can-the-earth...
https://archive.org/details/howmanypeoplecan00cohe
There are also a few articles discussing the question, though not with the detail of the book. Most are either paywalled or in PDF formats (which seems to strongly discourage online readers). Their quality and expertise strongly reward expended effort, do please read these if you're genuinely interested in the question.
https://lab.rockefeller.edu/cohenje/assets/file/257bCohenHow...
http://www.oneonta.edu/faculty/allenth/Class-Readings-Passwo...
A review of Cohen's book, "On Human Carrying Capacity: A Review Essay on Joel Cohen's: How Many People Can the Earth Support?"
https://www.jstor.org/stable/2137692 (http://libgen.rs/scimag/10.2307%2F2137692)
And a hearty recommendation from science fiction author Kim Stanley Robinson:
https://www.theguardian.com/books/2020/oct/12/there-is-no-pl...