To reiterate my points:
1. The said entity (handle 2D44) does not cause crash with the code as you showed in GetHandle() with my AutoCAD2021, while it is in the group created by your code;
2. If the GetHandle() method is meant as you said, then you do not need it: you have already had the ObjectId, hence had the access to Handle by ObjectId.Handle property, why do you need to open the entity in transaction by the ObjectId and then get its Handle?
3. Yes, I also saw lot of code samples of getting hold of MdiActiveDocument in beginning of each method, regardless what is passed in as parameter. In AutoCAD programming, while in majority of cases, the code is dealing with MdiActiveDocument, but it does not mean that introduce unnecessary dependency to a method, which is supposed to be a black box to its caller, is good practice.
Example 1:
public void DoSomethingWithEntity(ObjectId entId)
{
var db=entId.Database;
// do whatever with the database, the entity
}
Example 2:
public void DoSomethingWithEntity(ObjectId entId)
{
var db=Application.DocumentManager.MdiActiveDocument.Database;
// do whatever with the database, the entity
}
Obviously the method of example 1 can be used against different drawing: mdiActiveDocument, side database, or drawing opened, but not MdiActive ones (opened drawing with command without session flag); while the method in second example can only be used with MdiActiveDocument. So, the first method is more generic, a good programming practice.