Preheat oven to 400 degrees F. Cook tortellini according to package directions. Drain; set aside.
For sauce, in a medium saucepan cook onion and shallots in hot butter over medium heat until tender. Stir in cream and milk. Bring just to boiling. Remove from heat. In a small bowl lightly beat egg yolks. Slowly add about 1 cup of the hot mixture to the beaten yolks, beating until combined. Return all of the egg yolk mixture to saucepan. Cook and stir over medium-low heat about 10 minutes or until slightly thickened and just bubbly. Stir in Parmesan cheese, sage, and pepper.
Transfer half of the cooked tortellini to a 2-quart rectangular baking dish. Sprinkle with the Gruyere cheese. Pour half of the sauce over tortellini. Top with the remaining cooked tortellini, the walnuts, the prosciutto, and the remaining sauce.
Bake about 20 minutes or until top is lightly browned and mixture is bubbly. Let stand for 10 minutes before serving.