Event grid is used for event based architecture/event programming. The events are pushed at the event grid topics (i.e. through event sources) and there are event handlers that are triggered based on the configuration specified in your event grid subscription.
In your scenario your application is sending events to event grid topic and the function is configured as the endpoint of your event grid subscription for that topic. In your function app code, you are again sending the event to the event grid topic (not sure if it is the same or a new topic).
Your setup cannot work for bi-directional communication as event grids are not meant for this. If you still want to use, then when you are sending the events to the event grid topic from functions then you need to create an event grid subscription (endpoint configured as your webhook endpoint) on that topic where you are sending the event from the function app.
Alternatively, you can refer to this for a comparison of messaging services.
To answer your query why you are getting 401 error when sending an event to event grid topic. If you look into your below code you are not passing the header for authentication. You need to pass header with "aeg-sas-key": "youreventgridtopickeys". You can refer to post to custom topic for more details.
Feel free to reach out to me if you have any queries or concerns.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.