Dreams are our private documents. The dreams of different people in different periods cannot have the same unified answer similar to that of Duke Zhou. But what you said is too simple, you can only talk in general terms. Generally speaking, death in dreams is often not directly related to death in reality. The death and grave in the dream often just symbolize an end and a failed ending. Just like we often say that "the heart is dead" and "marriage is the grave of love", if you don't feel terrible in your dreams, but just depressed, lost and panicked, then I think you may feel lost in reality recently and feel that you have missed something and lost something irretrievably.
It's also interesting to write "myself" in the grave instead of my name. Generally speaking, names should be written on graves, but names actually symbolize our identity, role and position in society. Your name is not in your dream, but the word "yourself" is used instead. Does it also mean that you are dissatisfied with yourself in society and the evaluation of people around you, and you don't fully accept and recognize your social role?
Just saying, don't be surprised.