No worries. These things happen. As long as you don't have too many rejected edits, you'll have nothing to worry about.
From Do the editing penalty durations increase?
Edit bans come in 3 forms:
- When you have enough edits rejected in a short period of time, you will receive an automatic suggested edit ban that lasts 7 days. This
ban is not shorter or longer. So if you've been banned for a period
more or less than 7 days, you likely did not get an automatic ban, and
instead were banned manually by a moderator
- Manual edit bans can be levied by moderators for any infraction that they feel warrants a ban (such as editing spam into posts).
- IP level bans used to rate limit anonymous suggested edits. More explanation on it is in
How can an anonymous user get an edit ban if all their edits were approved?
If moderators find that you have a history of unnecessary edits, they might step in and ban you from suggesting more edits, but this wont be the case for a single rejected edit.
I am not sure whats the cause of this, but I assume the author of the answer edited it while I was sending the suggested edit
Presumably. If a post is edited by the same user with 5 minutes of it being posted/their latest edit (and no other interaction to the post has taken place), the edit will be part of the last revision. I assume that indeed the OP posted their answer, then realized that their code wasn't formatted and so edited it again within this grace period.
You can't retract or cancel suggested edits.
Not much you can do now. Just wait for it to be rejected by the community (already the case here) and move on.