All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
The view which you mentioned was held by one of the leading Imaams of the Taabiʻoon (generation following that of the Companions), namely Mujaahid who interpreted the prohibition in this regard to be of a general indication, applicable to both living beings and inanimate objects. However, the majority of the scholars held an opposing opinion in this regard, and their view is stronger.
An-Nawawi wrote:
“These ahaadeeth explicitly prohibit making images of animals and underline that the prohibition in this regard is rather emphasized. As for the trees and the like of inanimate objects, it is not prohibited to make images of them or earn a living from it, regardless of whether trees are fruitful or not. This is the opinion of all the scholars except for Mujaahid, who held that making images of fruitful trees is disliked. Al-Qaadhi said, ‘Mujaahid is the only one who held this view.’ Mujaahid relied on the Qudsi hadeeth which reads, ‘Who would be more unjust than the one who tries to create the like of My creation?’ The majority of the scholars, on the other hand, relied on the hadeeth which reads, ‘The makers of these images will be punished on the Day of Resurrection, and it will be said to them, 'Breathe life into that which you have created,'’ (i.e. make it a living animal like the one you imitated.) This hadeeth interprets the narration: ‘Who would be more unjust than the one who tries to create the like of My creation?’ This is supported by the hadeeth of Ibn ʻAbbaas, may Allah be pleased with him, which reads, ‘If you have to, then make (images of) trees and inanimate things.’”
Allah knows best.