Assuming you can't pay the fee, then you should make it clear to the journal that you can't pay the fee. What happens next is up to them. It's possible they will retract the article; it's also possible they will publish it anyway as a gesture of goodwill.
Will it affect your chances of future publications in other journals of the same publisher? It's possible. Modern editorial management systems are capable of tracking submissions by the same person, and the data can be shared between journals. The real question is whether the journal will take action. They are more likely to take action if they think you were being exploitative, and less likely if they think it was a genuine mistake. In the former scenario, the exploitative author submits to the journal knowing they will not publish there, but are making use of the journal's resources/time to get "free" peer review for their paper. It's similar to how taking up "free consultation" services with no intention of actually purchasing the service can be viewed as exploitative. To avoid looking exploitative, you should definitely say that you noticed the journal was open access too late.