I was riding up a steep road when I shifted to a lower gear and I was pushing really hard on the pedals. Then I checked my freewheel, one the cogs was slightly bent I don't know if it got bent because of that or it was like that from the start (used bike but new). so can pushing hard while shifting bend the teeth or a cog on a freewheel?
So the damage happened at the same time you shifted to a lower gear ? I'm guessing you were pushing hard because its a steep grade, and the chain was not fully engaged in the bigger cog when you pushed hard.
Image shows a 28 and 32 tooth, so this could be exacerbated by a larger tooth difference, like it the final cog is a "megadrive" than can be a 10 tooth difference from the next cog.
So this chain lay, combined with
- a lot of leg power because you're going up a hill
- probably the rider is out of the saddle and leaning forwards for more power,
- a smaller front chainring working to multiply the leverage
- a chain that has no particular weak spots
could twist a part of a cog. And it would look like a twist too. The other option is a fold, which would have some other kind of cause.
Also, what "groupset" or level is the cassette? If its non-groupset shimano, or some pot-metal quality cheese-grade steel cog then that increases the likelyhood it failed.
As for fixing it, you may be able to straighten the cog. Likely its all secured together into one block so you're working around the other parts. Be aware that if you do get it straight, the metal will be permanently weakened and more likely to do this again.
The best option is to replace the damaged freewheel, which can be galling if there's significant life left in it.
This exact scenario recently happened to me. I was powering up a grass bank on my cargo bike but it was softer than I thought and I slowed down fast. I quickly grabbed several gears on the rear derailleur to get up it, and I didn't have time to let off the pedals. It went fine, but the next day my bike had a shifting problem in low gears. When I tried to adjust the rear derailleur, I found the second gear was bent. I am positive it was from shifting under load.
I was able to pound the gear straight enough to mostly work until a new cassette came in the mail. The chain was not damaged and I'm still using it. This was a stock Mongoose Envoy with a 8 speed cassette. The purpose of this story is to illustrate that this can indeed happen when shifting under load.