Either of your suggestions may apply.
Cambridge, Merriam Webster and Collins dictionaries all agree that to burgle means to enter and steal. Here is Cambridge:
Cambridge
Burgle: to enter a building illegally and steal things
In Britain, burgle has the legal sense of entering with stealing, or with the intent to steal:
Sentencing Council
Burglary:
Burglary is committed when an offender either:
a) as a trespasser enters a building intending to steal, inflict grievous bodily harm or do unlawful damage; or,
b) having entered as a trespasser steals or attempts to steal, or inflicts or attempts to inflict grievous bodily harm.
If he tried to burgle, we may assume that he tried to enter (with intent to steal) but failed, or he entered but failed to steal. In either case, it did not go well for some unstated reason. As examples, we may imagine he tried to enter but failed because he cut his arm on broken window glass, or we may imagine he entered but failed to steal because the building was empty, because there was a fierce guard dog or - as you suggest - because he was caught.