Upvote:3
What you're doing is called visa-shopping, and it's frowned upon by the Schengen countries.
The rules say that you should apply to the country that is the main purpose of your visit, or where you'll spend most time. For your original plan, the Czech Republic is the place to apply.
If the immigration officers suspect what's really gone on they can make life difficult for any future visa application.
It's not clear from your question, but you seem to indicate that you have already started (and possibly completed) the process with Hungary, and arranged your flights.
Changing your itinerary to spend most time in Budapest might be a solution, but it's a six hour drive (longer by bus) from Prague to Budapest, passing through Austria or Slovakia on the way. It's going to be difficult to explain, then, why you flew to Prague for a holiday in Budapest.
Changing your flights and going to Prague another time might be a better option.