Can you get in trouble with the law for getting married and not waiting the six months required in your divorce agreement?
If what is meant by "trouble" is being charged with a crime,
then no such an issue is a civil matter not a criminal one.
However, the second marriage may very well be deemed as illegal and
you may have to do the whole thing again after the waiting period
has expired. There is also a chance the divorce would be voided and
have to be refiled, although that is highly unlikely unless there
are other unresolved issues.