I have to agree with @vojtech59738 that it's likely you've gotten a defective screen. The ones that support the S-Pen actually have two digitizers; one for your fingers and a separate one for your S-Pen. The S-Pen digitizer is obviously defective and the most likely solution is going to be to have to replace the screen once again.
However, it would be worth your while to open the phone up and check and reconnect the screen connection; it is possible the repair shop just didn't get the display connector plugged in completely. You don't need to tear the whole phone down to do that; just check both ends of the display cable as shown in the Screen and Battery Assembly Replacement guide.
Samsung Galaxy S22 Ultra Screen and Battery Assembly Replacement - iFixit Repair Guide
Open the phone up and check both ends with a magnifying glass and a bright light. You're looking at both the cable and the board connectors for any signs of bent, broken or missing pins. If you find any bent ones, they can sometimes be straightened with fine tip tweezers. After that, clean them all with 90% or higher concentration isopropyl alcohol. Let it dry then reconnect everything, making sure both ends are plugged in securely. Power the phone on and retest.
If it still doesn't work after that, it might be worth your while to try replacing that cable that goes between the display and the motherboard, but in all likelihood you will most likely need to replace the screen again. Unfortunately those aren't cheap by any means; from the tenor of your post I assume going back to the shop that originally did the repair isn't an option, is it?