How to Make It
Preheat oven to 350°F. Place onion, carrots, celery, and apple in a large shallow roasting pan; top with thyme sprigs. Sprinkle pork all over with 2 teaspoons of the salt and 1 teaspoon of the pepper. Place pork, fat side up, on vegetable mixture. Pour 1 cup of the stock into roasting pan. Place in preheated oven; roast 1 hour.
Remove roasting pan from oven. Pour 1/2 cup of the stock into roasting pan; cover with aluminum foil. Return to oven; roast at 350°F until a thermometer inserted in thickest portion of pork registers 138°F, 40 to 50 minutes. Remove roasting pan from oven; transfer pork to a cutting board, and tent with foil to keep warm. (The internal temperature of the pork will rise to 145°F during resting.)
Scraping bottom of roasting pan to loosen browned bits, strain pan drippings into a large glass measuring cup; discard solids. Skim fat from strained drippings; add enough of the remaining stock to measure 1 cup liquid.
Melt butter in a medium saucepan over medium-high. Add shallot; cook, stirring often, until softened, about 3 minutes. Stir in flour; cook, stirring constantly, 1 minute. Add maple syrup, vinegar, and pan drippings mixture; whisk until smooth. Let mixture come to a boil, stirring often; continue boiling until mixture thickens, about 4 minutes total. Remove from heat; stir in chopped thyme and remaining 2 teaspoons salt and 1/2 teaspoon pepper. Slice pork into 1/2-inch-thick slices. Serve with gravy.