Issue related to Loft

Seems to work just fine, assuming this is what you intend.

Actually I’m trying to loft it but it says “Operation failed because the resulting body would not be valid”. So can you help me out here? What could be the issue?

Most likely the issus is with the connection of the guide lines. Make sure the areas circled in red are connected properly to the front and rear sketch. The bright blue lines are the gulde lines.