I am not a doctor, but my understanding is that Doak is currently unavailable to prevent injuries in the future.
With hamstring injuries players are normally sidelined for a few weeks. Some players keep getting them and have their careers affected.
The trend seems to be that instead of letting the injury heal itself, we see more and more players have surgery and be sidelined for 3-5 months. De Bruyne was out second half of 2023 after hamstring surgery. Arsenal this season had Saka, Havertz and Gabriel out long spells after hamstring surgery. Even Tarkowski that never is injured had surgery to fix his hamstring.
Doak had surgery to be 100% instead of being rushed back and risk getting 2-3 hamstring injuries a season the rest of his career.