Unfortunately, independence and youthful thoughtlessness led Metastasio into other deviations from Gravina's lessons, less praiseworthy than reading Tasso. The poet was warm-hearted, hospitable, and gay. He was surrounded by companions ready to share the pleasures and luxuries which his money procured; while he believed his future prospects secured by the promises he received from influential protectors. Two years had not passed before he was undeceived. He had squandered the greater part of his fortune; he had made many enemies, and his friends fell off. With a firmness worthy of his education, he stopped short of actual ruin; and, disgusted with the society of Rome, and the treatment he had suffered, he changed, on a sudden, his whole plan of life, following up his new designs with zeal and perseverance.
"There lived at Naples," says his biographer, Venanzio, "a rough incult lawyer, called Castagnola, covered with rust and dust, and an enemy to every thing that was not allied to forensic struggles and turmoils." Wishing to place a barrier between his will and his inclinations, Metastasio went to Naples, and chose this man for his master, believing that his asperity and detestation of poetry would serve to guard him against having again recourse to an art towards which nature impelled him. For nearly two years he submitted to the control of Castagnola, and devoted himself to the severest study. But he was well known at Naples, and his talents were appreciated. He was perpetually solicited to compose epithalamiums, theatrical pieces, and occasional verses. He resisted the temptation as long as he could: at last, commanded by the viceroy, he consented to write a drama, to celebrate the birthday of the empress Elizabeth Christina, wife of Charles VI. He, however, obtained a promise of secrecy, and hoped to conceal his crime from his master. To accomplish this, he was obliged to steal for his work the hours usually devoted to sleep; but his natural vein, checked for some time, flowed with such felicity, that he accomplished his task before the appointed time. The "Orti Esperidi" charmed his august employer, who bestowed on it the highest praise, and presented the author with a purse containing two hundred ducats.