Loneliness runs much deeper than the physical aspect of not having another person with you. Don't confuse it with solitude, which is of choice, is relaxing and often a form of self-care to recharge.
Do you practice self-compassion? Do you treat yourself with care and love when you have come across your own mistake or fault?
This consists of:
Being Kind to Yourself - Be gentle and understanding rather than being hard on yourself or overly critical.