What happens if the grant requirement for open access publications is not respected? [small & short-duration grants] EDIT: I am referring to short duration (1-2 years) small grants (10k-30k $/euros) usually given to PhD or post-docs. The amount needs to cover material, conferences, publications, etc. Publishers now charge up to 10k for open access, so towards the end of the funding period when most work is being published the grantee might be short of 10k for a publication.
It is becoming increasingly common for research funded with public money to be published as open access with gold (expensive but immediately open access) or green standard ( free self archiving after 6 months). This is part of the grant agreement which is a binding legal contract.
What happens if a researcher publishes not in open access because cannot afford to pay the open access fee? Some publishers are increasing the open access fees and I have discussed with colleagues, particularly junior scientists and postdocs with limited funding, about this dilemma. Careers depend also on publications appearing in certain journals, so choosing a target journal for financial reasons seem to be a great disadvantage for younger scientists.

Will there be any legal or other potential consequences such as being banned from applying for grants from the same institution?
Will there be any non-written consequences such as being flagged as a
noncomplying grantee?**

PS: I'm not looking for advice on how to find money for paying the open access fees, there are already questions covering that topic.
I'm most familiar with the US NIH.
They write:

Non-compliance will be addressed administratively, and may delay or prevent awarding of funds.

For the most part, NIH seems focused on awareness and trying to encourage compliance, rather than strict enforcement. It seems many are not fully aware of the guidelines, which are quite new for some researchers who have published a different way for decades.
More generally, big funding agencies like to act through the institutions researchers belong to in encouraging compliance, whether for policies like this or for ethical policies like those for human/animal subjects research.
They can threaten to withhold their funds and even government funding more broadly from entire institutions, not just individuals. While cases of this threat actually being carried out are rare, it may mean that researchers find themselves more directly responsible to their institution rather than the funder. The institution has a large incentive to ensure local compliance and likely has more resources than the funding agency to follow up, as well as a broader range of sanctions.
For your particular situation, I have a hard time imagining a funding agency feeling too bad for your circumstance. If they're funding your work and demanding open access, they're implying that they expect you to use their funds towards those costs in addition to all the others (either directly or through the fungibility of money). &quot;I spent my money on other things and now can't afford to comply with your publishing requirements&quot; doesn't seem like a very good argument, since everyone they fund is in the same boat and since you've accepted their terms by accepting their funding.