Studies evaluating the local quality of death certification in Brazil focused on completeness of death reporting or inappropriate coding of causes of death, with few investigating missing data. We aimed to use missing and unexpected values in core topics to assess the quality of death certification in Brazilian municipalities, to evaluate its correlation with the percentage of garbage codes, and to employ a data-driven approach with non-linear models to investigate the association of the socioeconomic and health infrastructure context with quality of death statistics among municipalities. This retrospective study used data from the Mortality Information System (2010-2017), and municipal data regarding healthcare infrastructure, socioeconomic characteristics, and death rates. Quality of death certification was assessed by missing or unexpected values in the following core topics: dates of occurrence, registration, and birth, place of occurrence, certifier, sex, and marital status. Models were fit to classify municipalities according to the quality of death certification (poor quality defined as death records with missing or unexpected values in core topics ≥ 80%). Municipalities with poor quality of death certification (43.9%) presented larger populations, lower death rates, lower socioeconomic index, healthcare infrastructure with fewer beds and physicians, and higher proportion of public healthcare facilities. The correlation coefficients between quality of death certification assessed by missing or unexpected values and the proportion of garbage codes were weak (0.11-0.49), but stronger for municipalities with lower socioeconomic scores. The model that best fitted the data was the random forest classifier (ROC AUC = 0.76; precision-recall AUC = 0.78). This innovative way of assessing the quality of death certification could help quality improvement initiatives to include the correctness of essential fields, in addition to garbage coding or completeness of records, especially in municipalities with lower socioeconomic status where garbage coding and the correctness of core topics appear to be related issues.