Well, a good jumping off point for debugging an endpoint would be the endpoint logs, following the
documentation associated with it.
Following that, if the information there isn't very clear, then the issue might be in the backend, which in this case would be your SQL instance; if this SQL instance is a CloudSQL instance, then you merely need to follow the
documentation associated with that. On the other hand, if your SQL instance is inside of a Compute Engine Instance or an App Engine Instance, then you might find something in the logs of those instances, however, I believe you'll have more luck accessing the logs inside of the SQL instance itself if that's the case.
That being said any advice I give on the logs of a SQL instance can be muddy because I'm not sure what SQL instance you're using? CloudSQL offers MySQL, PostgreSQL and Microsoft SQL Server, so I am somewhat well versed in those three, however if you use a different solution then my attempts at helping will mostly be a best-effort on my part, because I can't guarantee that I'll be very knowledgable.
That being said, it would be nice to have a minimum reproducible example of your code? Y'know, just the basics of how you attempt to access instance, and the query you're trying to perform. Obviously we don't need to know the keys or anything exact about it, it's best to avoid any personal or private information getting in there.