Heat the oven to 300°. In an 8-inch square baking dish, combine the sliced shallots with the vinegar, two-thirds of the garlic, the celery, and thyme. Season with salt and pepper, then pour the olive oil over the top. Bake until the vegetables are confited and very tender, about 1 1⁄2 hours. Transfer the dish to a rack and let cool. Pour the vegetables and oil through a fine sieve into a bowl and reserve the vegetables and oil in separate bowls.
Increase the oven temperature to 375°. On a baking sheet, toss the celery root and parsnips with 1⁄4 cup of the reserved olive oil and season with salt and pepper. Bake until the vegetables are very tender, about 50 minutes. Scrape the roasted vegetables into the bowl with the confited vegetables and stir to combine. In another bowl, whisk the cream with the smoked salt and eggs until smooth.
Meanwhile, pour the remaining reserved olive oil in a small saucepan and heat to 350° on a deep-fry thermometer. Thinly slice the remaining 2 shallots and add to the oil along with the remaining garlic and cook until the aromatics turn golden brown and crisp, about 1 to 3 minutes. Using a slotted spoon, transfer the shallots and garlic to paper towels to drain and discard the oil.
Increase the oven temperature to 400°. Line the bottom of a 3-qt. oval baking dish with one-third of the bread, followed by one-third of the vegetables, half of the cod, and one-third of the cream. Add another third of the bread on top, followed by another third of the vegetables, the remaining half of the cod, and another third of the cream. Top with the remaining bread, vegetables, and cream and press the ingredients gently with your hands to compact. Cover the dish with foil and bake for 30 minutes. Uncover and continue baking until the casserole is browned on top and bubbly in the center, about 20 minutes more. Transfer the dish to a rack and sprinkle with the fried shallots and garlic before serving.