How to exclude sections of bad data from time-series data before training an LSTM network
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