Preheat the oven to 400 degrees F (200 degrees C). Place cauliflower, potatoes, and onions into a 9x13-inch glass baking dish and sprinkle rosemary over the top. Season liberally with salt and pepper. Add olive oil and toss vegetables until evenly coated. Roast in the preheated oven, tossing halfway through, until evenly browned, about 1 hour. Remove from the oven. Add lemon juice and toss with a metal spatula, scraping any browned vegetable bits off the bottom. Allow to cool. Fill blender halfway with roasted vegetables and add 2 cups stock. Cover and hold lid down with a potholder; pulse a few times before leaving on to puree. Pour into a big soup pot. Repeat with remaining vegetables and stock. Heat soup over medium heat until it boils. Season with salt and pepper to taste.