It is common to hear elderly in Portugal saying that dining and then going to sleep has a bad impact on one's health (apparently it is not only in Portugal).
From a National Institute of Health ncbi.nlm.nih.gov article we see that some foods may affect sleep
Such studies highlight a potential effect of macronutrient intakes on sleep variables, particularly alterations in slow wave sleep and rapid eye movement sleep with changes in carbohydrate and fat intakes.
However it is not clear to me how harmful the alterations in slow wave wave sleep and rapid eye movement are for one's health.
I do not want to get into much detail about problems that may result from eating before sleep, giving freedom to reflect upon them. They seem to be various, such as reflux, quality of sleep, or even weight gain, which, from healthline.com is considered conventional wisdom:
Conventional wisdom says that eating before bed causes weight gain because your metabolism slows down when you fall asleep. This causes any undigested calories to be stored as fat.
Is sleeping right after a meal bad for one's health?
Related but raising a different concern: Does eating just before sleeping cause nightmares?