Yeah cops can and do cook up all kinds of b.s probable causes after the fact.
The cop has to give you the reason right then and there, or provide a search warrant. This is why people who stopped by cops should always have their smartphone recording it.
If a cop is making up lies you can request their supervisor to come on site.