Yes, Virginia did try to say West Virginia could not lawfully secede from Virginia.
March 10, 1866 Congress passed a resolution recognizing West Virginia and in 1870 the Supreme court decided in favor of WV.
Both the 1866 act of Congress and the 1870 Supreme Court ruling concerned only the incorporation of two eastern Panhandle counties into West Virginia, not the existence of the state. By 1866 Congress hardly needed to “recognize West Virginia”; they had already done so in 1862 by passing a law for the admission of West Virginia and in 1863 by seating members elected from the new state.
The first postwar Virginia legislature, meeting in December 1865, did in fact repeal the act of May, 1862 by which “Virginia” (actually a rump legislature representing mostly what would become “West Virginia”) consented to the creation of West Virginia. This was a purely symbolic gesture. In practical terms, they were interested only in recovering Berkeley and Jefferson Counties, which had been added to West Virginia only after a dubious plebiscite. They sued to recover those two counties but lost in 1870.
Virginia also sued West Virginia to force West Virginia to pay a share of Virginia’s state debt, and on that occasion (1911) she won.
West Virginia did not “secede” from Virginia. After Virginia seceded from the Union, a group of delegates met in Wheeling, (now) WV and declared themselves to be the Restored Government of Virginia: Restored Government of Virginia - Wikipedia
That “true” government of Virginia gave permission, pursuant to the Constitution, for the new state of West Virginia to be formed from part of Virginia.
After West Virginia became a state, the Restored Government moved to Alexandria, and then to Richmond after the war ended. The Restored Government then transitioned into the government of Virginia that is present today. Further, it was an express provision for Virginia’s readmission to the Union that it recognize the creation of West Virginia.
A bit of a cheat? Yes, but a state cannot secede from the Union and then complain that it wasn’t part of the legal process that went on in its absence.
A just to follow up a bit, this Restored Government of Virginia was not four guys in their mother’s basement, similar to sovereign citizens who were just a complete sham looking for legitimacy, nor similar to the Republic of Texas group some years ago.
They made a legitimate, even if a bit of a cheat, effort to form a government in good faith. The delegates were elected members of the Virginia Legislature from the western counties. They offered (of course knowing that they wouldn’t participate) loyal citizens of the eastern counties an ability to take part in the proceedings. They submitted major items for a popular vote, yes, again knowing that the eastern counties would not participate and Union occupied areas of the western counties would vote heavily in their favor.
But it was war time. If you were a loyal Union citizen, what else could you have done at the time to express your opinion that secession was wrong and take action in favor of a unionist Virginia? To not recognize this group, or to retroactively undo its actions would be to say that secessionists can secede, yet when they are forced back into the fold, they then get a free vote to do what they failed to do through arms.
To argue (which I know you haven’t) that the creation of West Virginia was somehow illegitimate, one would have to likewise argue that the 14th and 15th amendments were illegitimate and get rid of all of the reconstruction laws because they were similarly pushed through with the “coerced” consent of the seceding states.