If it has been a significant amount of time since you’ve swam, you can’t expect to get right back into the pool and start sprinting. Whether you are recovering from surgery or trying to swim despite an injury, your body is not in optimal shape.
Try not to get frustrated with yourself. It isn’t your fault that you aren’t in the same shape you were in before you were injured. You may have to ease back into your normal training. However, that doesn’t mean you won’t ever get back to the speed you were before.