Your idea is a good one. Another idea is to upsample or aggregate your data. For example, average by week if you generally have a couple of missing days in every week. A similar question on Stack Exchange: https://stats.stackexchange.com/questions/374935/how-to-deal-with-really-sparse-time-series-data-for-a-binary-classification-task

Only top voted, non community-wiki answers of a minimum length are eligible