It would make sense that you would be able to get the worm back after gutting the fish. This would make fishing slightly easier since you would not have to dig another worm out of the ground. It would also save the life of the item you use to obtain the worm.
Game Version: 1.20.155981