Regarding slavery in territories, the first Congressional prohibition of same predates the constitution. Even the weaker Congress under the Articles of Confederation felt that it had the power to ban slavery in federal territories, and famously did so for the lands NW of the Ohio River via the Northwest Ordinance of 1787.
The 1787 Constitution grants Congress the power to adopt “all needful rules and regulations” for federal territories, which seemed to place the earlier slavery ban on solid ground. The new Congress under the Constitution repassed the Northwest Ordinance, with many framers including James Madison voting in favor, and George Washington signed it into law. Nobody raised constitutional objections.
Later Congresses continued to ban slavery in territories, down through and beyond the Missouri Compromise of 1820. None of the above prevented Roger Taney, via tortured reasoning, from finding such a ban unconstitutional in 1857. After the South seceded, Congress nonetheless told Taney to shove it and repassed a ban on slavery in all territories in 1862, and three years later the Thirteenth Amendment made the matter moot.
Regarding reestablishing slavery in a state–no state ever did this, but they certainly could have. Illinois was first settled mostly by Southerners, and after Illinois was admitted in 1818 there was a loud and active movement to convert Illinois to a slave state. The movement failed, but it was a close-run thing.